Quotas and limits in Cloud Functions
Cloud Functions has the following limits:
- Quotas
are organizational restrictions that can be changed by technical support. - Limits are technical limitations due to Yandex Cloud architectural features. You cannot change the limits.
If you need more resources, you can increase quotas in one of the following ways:
- Generate a request for a quota increase
. You must have thequota-manager.requestOperator
role or higher, such aseditor
oradmin
. - Contact technical support
and tell us which quotas you want increased and by how much.
Note
To choose correctly which quotas to increase, familiarize yourself with their characteristics and interrelationships.
Quotas
Type of limit | Value |
---|---|
Number of triggers per cloud | 100 |
Number of functions per cloud | 10 |
Number of tags per function | 10 |
Number of concurrent function calls (for all functions in each availability zone) | 10 |
Number of function instances per availability zone | 10 |
Total RAM for all running functions per availability zone | 20 GB |
Number of provisioned function instances per cloud | 2 |
Number of concurrent operations on a single function and its versions | 10 |
Number of concurrent operations on all functions and their versions per folder | 15 |
Number of concurrent operations on all functions and their versions per cloud | 20 |
Number of user networks per cloud | 1 |
Number of network packets per second per function instance | 10,000 |
For more information about relationships between quotas, see Relationship between quotas.
Limits
Type of limit | Value |
---|---|
Maximum uploaded file size | |
ZIP archive from the management console | 3.5 MB |
ZIP archive from S3 bucket | 128 MB |
Unzipped ZIP archive from S3 bucket | 680 MB |
Other restrictions | |
Maximum size of the JSON structure of a request and response | 3.5 MB |
Maximum size of temporary files | 512 MB |
Maximum function execution time before timeout, including first call initialization1 | 1 hour |
Maximum RAM per function instance | 8 GB |
Maximum total environment variable storage, including variable names2 | 4 KB |
Maximum number of triggers per message queue | 1 |
Maximum message size per trigger | 256 KB |
1 A timeout longer than ten minutes is only available for long-lived functions.
2 Lockbox secrets are provided via environment variables and are also counted towards this limit.
Other restrictions
When installing dependencies:
- The total time for installing dependencies is limited to five minutes. After it expires, the build will fail with an error.
- For dependency installation, 1 GB of RAM is allocated, of which 700 MB is allocated for temporary file storage (tmpfs). Memory is consumed by active processes and files created and downloaded during the build.
- 50% of the CPU is available.
If the build takes longer than five minutes or requires more resources, build the dependencies yourself and download the function as a ZIP archive.
Relationship between quotas
The quotas for concurrent calls, function instances, and total RAM are interconnected. To increase the number of function calls, you should increase:
- The quotas for concurrent calls and instances equally.
- The quota for total RAM to the value of the actual consumption by the instances.
The number of concurrent calls and function instances are interconnected as follows:
- It makes no sense requesting more function instances than concurrent function calls. One instance is used to process each call. If there are more instances, they remain idle.
- You might only consider setting the number of concurrent calls higher than that of instances to prevent a function call from ending in an error when all instances are busy. In this case, the call is queued and considered to be in progress, while also being counted towards the quota for the number of concurrent calls.
Instances and calls are randomly distributed among the availability zones. Cloud Functions does not guarantee their even distribution among the zones. For example, all calls, no matter how many, might end up in the same zone. Therefore, with a quota of 10, you can simultaneously call from 10 to 30 functions and use from 10 to 30 instances, but only 10 are guaranteed.
The quota for total RAM across all the running functions limits the number of instances. Set the total RAM quota equal to the number of instances times the average RAM of the functions they will be used for. For example, if you call 10 functions, each with 4 GB RAM, the first 5 instances will already use up the whole 20 GB RAM quota. As a result, new instances needed for the remaining 5 calls will not be created. In this case, you need to set the total RAM quota to 40 GB.
The quotas for the number of concurrent operations on all functions and versions only limit such operations as creating a function/version and deleting a function. These quotas do not affect the number of concurrent function calls and instances.