I use following firebase cli command to deploy my firebase functions
firebase deploy --only functions
How can I limit the number of instances for functions, when deployed like this? It looks like gcloud
command has --max-instances
option to limit instances, but couldn't find anything like this for firebase cli.
To increase quotas above the defaults listed here, go to the Cloud Functions Quotas Page, select the quota(s) you want to modify, click EDIT QUOTAS, supply your user information if prompted, and enter the new quota limit for each quota you selected. These affect the total amount of resources your functions can consume.
if daily sms are exceeding limit go to : firebase console > open settings > open usage and billing check your daily limit.
Cloud Functions scales by creating new instances of your function. Each of these instances can handle only one request at a time, so large spikes in request volume might result in creating many instances.
Cloud Run has the capability to handle up to 80 concurrent requests with the same instance. At the opposite, Cloud Functions create as many instances as the concurrent requests.
You can set the maxInstances
when you write the function, using runWith
and passing in RuntimeOptions
Something like this:
functions
.runWith({maxInstances: 3})
.https.onCall(() => {});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With