On what depends a cloud function run-time?

24 views
Skip to first unread message

Karlo A. López

unread,
Apr 27, 2018, 10:08:12 AM4/27/18
to Firebase Google Group
Hello, Im building an app with cloud functions (HTTP) for the first time. I've seen that although I have functions with up to 5 firestre queries the response time is actually pretty good. There are functions that the average runtime is of 200ms and thats great. 

My question is why every first time I call the function always gets a long response time, and then the next calls are so more fast than the first one. Heres my average response time for one of my functions, the other ones are pretty the same, 1 long time load and then everything fast:


Im still in development but I wonder if there's a way to always get the average response time after a long period of the function not being used.


 

Michael Bleigh

unread,
Apr 27, 2018, 11:25:23 AM4/27/18
to fireba...@googlegroups.com
Functions will scale to zero running instances when not used for a while -- this is what allows us to bill only for usage. See these docs: https://cloud.google.com/functions/docs/concepts/exec#cold_starts for a bit more info.

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/1605679d-c84d-4c38-a084-d67dceec4549%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Karlo A. López

unread,
Apr 28, 2018, 12:20:01 AM4/28/18
to Firebase Google Group
Hi Michael thanks for the info. So even if I pay any plan I will get running with zero instances?? Thanks !!!
Reply all
Reply to author
Forward
0 new messages