GCP Cloud Function Instance lifetime

Viewed 376

I've worked with the AWS environment for 4 years, mostly with Lambdas. From my experience, I know that an "instance" of a Lambda function will live aprox for 2 hours.

Now I'm going to work for a project with GCP and their Cloud Functions: is there any information about how much time a CF "instance" will live?

I generally need to know that in order to better understand how frequently we will face a cold start.

1 Answers

This can get complicated since Cloud functions can be multi-regional and scale up and down as your apps need, from our experience it was about a 30-minute cooldown.

To quote the documentation:

The environment running a function instance is typically resilient and reused by subsequent function invocations, unless the number of instances is being scaled down (due to lack of ongoing traffic), or your function crashes.

You can find this and more, here: https://cloud.google.com/functions/docs/concepts/exec#function_instance_lifespan

Related