Runtime configuration

This section contains information about the runtime configuration options that you have when installing or reconfiguring a function.


Cloud Functions for Function Store lets you select runtime options such as the amount of memory to allocate to the function, the per-function timeout, and minimum/maximum function instances.

You'll find the Runtime section in the installing/reconfiguring modal of a function. Setting this will allow you to have some options to control the behavior of your function.

Memory allocated

The main purpose of memory allocation is to provide ways to dynamically allocate portions of memory to programs at their request, and free it for reuse when no longer needed. In some cases, your functions may have special requirements for a large allocation of memory.

You can set this value in the installing/reconfiguring process of a function. By default, the memory allocated to each function is 256MB.

Valid values for memory are:

  • 128MB

  • 256MB

  • 512MB

  • 1GB

  • 2GB

  • 4GB

  • 8GB


Function execution time is limited by the timeout duration, which you can specify at function deployment time. By default, a function times out after 60 seconds, but you can extend this period up to 540 seconds.

It's highly recommended that your function avoid timeouts using a combination of some techniques. For example, by setting a timeout that is higher than your expected function execution time, and by tracking the amount of time left during execution and performing cleanup/exit early.


By default, Function Store scales the number of running instances based on the number of incoming requests, potentially scaling down to zero instances in times of reduced traffic. However, if your app requires reduced latency and you want to limit the number of cold starts, you can change this default behavior by specifying a minimum number of container instances to be kept warm and ready to serve requests.

Similarly, you can set a maximum number to limit the scaling of instances in response to incoming requests. Use this setting as a way to control your costs or to limit the number of connections to a backing service such as to a database.


To avoid cold starts for your application and reduce application latency, you can set a minimum number of instances. Each function has its own minimum instances setting and it's recommended to implement this if your application is latency-sensitive.

Note that setting a minimum number of instances incurs cost.

Billing costs

GCP charges you depending on which instances you run. It will still charge you for a minimum number of instances that are idle. The cost of keeping one idle function instance warm is less than $6.00 a month, but sometimes, it's quite difficult to estimate the final cost of cloud run.

That's why the Firebase CLI provides a cost estimate at deployment time for functions with reserved minimum instances, and GCP offers a way to calculate this with their Pricing calculator.

For more information about this topic, visit the GCP Cloud Run pricing page.


You can set a maximum number of instances for a function during deployment. Each function has its own maximum instances setting and scales independently of each other.

If you don't specify a max-instances limit, Function Store is designed to favor scaling up to meet demand over limiting throughput. This means that the number of simultaneous instances that your function might have is effectively unlimited unless you've configured such a limit.

Note that setting maximum instances to 0 results in clearing existing maximum instances limits. Setting a 0 value does not pause your function.

Setting memory, timeout, and autoscaling in Function Store

To set memory allocation and timeout in the installing/reconfiguring modal of a function:

  1. In Function Store, go to the Marketplace.

  2. Search for the function you want to install.

  3. Click on the Install button.

  4. Select a project where you want to install it.

  5. Fill in the Environment Variables values.

  6. Scroll down and click on the Runtime section.

  7. Select a memory allocation from the drop-down menu labeled Memory allocated.

  8. Introduce a value in Timeout.

  9. Set a minimum and a maximum number of instances in Autoscaling.

  10. Click Install to initiate the installing process.


For more information about memory allocation, please visit these pages:

Last updated