top | item 16557514

(no title)

helpfulgoogler | 8 years ago

According to [1], the standard quota is 1,000,000 invocations per 100 seconds and can be increased. Maybe try asking again for increased quota? If the documentation is incorrect, please file an issue [2].

Counter-intuitively, ending the response before processing the data may actually be hurting your p99 response time. According to [3], instances which are not currently handling a request get very little CPU and generally don't make any progress. This means that this work will still be waiting to be done when the next request comes in and can slow it down. You may even end up with an instance trying to process several requests' data and also trying to handle another request on top of that. This last request is going to get an overloaded instance and likely be very slow. Further, the function isn't guaranteed to ever be run again, so that deferred work might not even ever happen.

It probably will cause you to use more of your invocations per 100 seconds quota, but you really shouldn't start background processing tasks in a Google Cloud Function that continue after completing a request.

[1] https://cloud.google.com/functions/quotas [2] https://issuetracker.google.com/issues/new?component=187195&... [3] https://cloud.google.com/functions/docs/bestpractices/tips

discuss

order

dillondoyle|8 years ago

I have paid support. It's socket connections we're hitting super quick.

Interesting and thanks I had no idea on the end response CPU time. It's just storing the json to Google Cloud Storage but it does take 100-300ms it seems!