Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a trigger limit for Firebase Cloud Functions?

I plan to watch a Firebase database node for create/delete and reflect that to another database node using Cloud Functions.

Is there a limit for such an operation? For example assume 10000 nodes added at once which should trigger 10000 inserts somewhere else, is this acceptable?

UPDATE:

I see these limits in Quotas section: Max concurrent invocations for a background function and Max invocation rate for a background function

Does that mean if I make more than 1000 requests, rest (9000 for the example above) gets disregarded or just gets slower to finish them all?

like image 352
Bogac Avatar asked Apr 12 '18 14:04

Bogac


People also ask

How long can Firebase Functions run for?

Time Limits60 minutes for HTTP functions. 10 minutes for event-driven functions.

How many requests can a cloud function handle?

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.

Does Firebase have a limit?

While not a hard limit, if you sustain more than 1,000 writes per second, your write activity may be rate-limited. 256 MB from the REST API; 16 MB from the SDKs. The total data in each write operation should be less than 256 MB. Multi-path updates are subject to the same size limitation.

What is the maximum execution time for a cloud function?

Function execution time is limited by the timeout duration, which you can specify when you deploy a function. By default, a function times out after one minute (60 seconds), but you can extend this period: In Cloud Functions (1st gen), the maximum timeout duration is nine minutes (540 seconds).


1 Answers

Rate limits won't drop events. If they did, that would be exceptionally bad, and your app would not scale.

Rate limits are in place to prevent a massive update from spinning up potentially millions of instances concurrently. Instead, Cloud Functions will limit the maximum concurrent number of invocations, and force all the events to go through that max instead of trying to handle them all at the same time. The events will be processed as fast as your function can deal with them, within that concurrent maximum.

like image 115
Doug Stevenson Avatar answered Oct 11 '22 21:10

Doug Stevenson