This topic describes how to manage quotas for Function Compute resources. It also outlines the usage limits of various Function Compute resources, including service resources, function execution resources, triggers, layers, regions, and images.
This information is particularly useful to new users who do not have a clear understanding of function principles, helping them avoid unexpected costs caused by incorrect configurations or code errors, such as recursive invocations and infinite loops.
Even with resource limits in place, unexpected costs can still arise from the improper use of provisioned instances. For more information, see Instance modes.
You can view the quotas for Function Compute resources in the Quota Center console. If the default quotas do not meet your business requirements, you can apply for adjustments in the Quota Center console.
ImportantHowever, Quota Center only allows applications for quota adjustments within a certain range. For quotas that exceed this range, you can request additional adjustments via tickets. When you attempt to raise the quota beyond the upper limit in the Quota Center console, you will be prompted to use the ticketing process instead.
It is essential to provide a thorough explanation of your reasons and submit relevant business information when you apply for a quota adjustment. Failure to do so may result in automatic rejection of the application.
Function Compute imposes limits on specific resources. If the existing resources do not meet your business requirements and the corresponding limits are adjustable, you can submit a ticket to request an adjustment. Alternatively, you can join the DingTalk group (group ID: 64970014484) to contact us directly for assistance.
Quotas
Function Compute is integrated with Alibaba Cloud Quota Center. You can view the quotas for Function Compute resources in the Quota Center console. For more information about Quota Center, see What is Quota Center?
You can manage the following quotas for Function Compute resources in the Quota Center console.
Quota name | Description | Default value |
upper limit of concurrent instances | The maximum number of instances that can be created in a region. | 100 (The actual value displayed in the Quota Center console prevails.) |
limit of gpu card number Note GPU-accelerated instances include those accelerated by using GPUs of the Tesla and Ada series. | The maximum number of physical GPUs that can be used in a region. | 10 |
cpu max image size | The maximum size of an image after compression for non-GPU-accelerated instance deployment. | 10 GB |
GPU max image size | The maximum size of an image after compression for GPU-accelerated instance deployment. | 15 GB |
layer max num per function | The maximum number of layers for a single function. | 5 |
num triggers limit per function | The maximum number of triggers for a single function. | 50 |
code size limit | The maximum size of a code package (ZIP/JAR file) uploaded using the Function Compute console, a developer tool, or Object Storage Service (OSS). | 500 MB |
Code packages in the following regions cannot exceed 500 MB in size: China (Hangzhou), China (Shanghai), China (Shenzhen), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Hong Kong), Singapore, Japan (Tokyo), US (Virginia), and Germany (Frankfurt). In other regions, the size of a code package cannot exceed 100 MB.
Log on to the Quota Center console.
In the left-side navigation pane, choose Products > General Quotas.
On the Products with General Quotas page, select Elastic Compute from the Category drop-down list and then click Function Compute.
On the General Quotas page, perform the following operations as needed:
View quotas: You can view the description and total quota of each item.
Apply for a quota adjustment: If an adjustable quota does not meet your business requirements, click Apply in the Actions column to apply for a quota adjustment. For more information, see Submit an application to increase a quota.
View application records: You can click Application Records in the Actions column of a quota item to see the application history for that item.
Limits
Function Compute imposes limits on specific resources. If the existing resources do not meet your business requirements and the corresponding limits are adjustable, you can submit a ticket to request an adjustment. Alternatively, you can join the DingTalk group (group ID: 64970014484) to contact us directly for assistance.
Limits on service resources
Item | Limit | Adjustable or not |
Functions per service | 50 | Yes |
File Storage NAS (NAS) mount targets per service | 5 | No |
OSS mount targets per service | 5 | No |
Limits on function execution resources
Item | Limit for CPU instances | Limit for GPU-accelerated instances | Adjustable or not |
Temporary disk size | 10 GB | 60 GB | No |
File descriptors | 100000 | 100000 | No |
Total processes and threads | 1024 | 1024 | No |
Memory for a function | 32 GB | 32 GB | No |
Function execution duration | 86400s | 86400s | No |
Execution duration for an Initializer hook | 300s | 300s | No |
Execution duration for a PreFreeze hook | 90s | 90s | Yes |
Execution duration for a PreStop hook | 90s | 90s | Yes |
Request payload size of a synchronous invocation | 32 MB | 32 MB | No |
Request payload size of an asynchronous invocation | 128 KB | 128 KB | No |
Throughput | 1 Gbit/s to 5 Gbit/s | 1 Gbit/s to 5 Gbit/s | No |
Size of a log entry | 32 KB | 32 KB | No |
Size of a code package (Base64-encoded ZIP file uploaded using an SDK or API) | 100 MB | N/A | Yes |
ZIP files uploaded through SDKs must be Base64-encoded, which increases the sizes of the original code packages. In addition to the code packages, the request bodies that are used to create and update functions also include other components such as function configurations. Make sure that the combined size of the Base64-encoded code package and all other content in the request body does not exceed 100 MB.
Limits on triggers
Item | Limit | Adjustable or not |
Number of native OSS triggers that can be associated with a bucket | 10 | No |
You can associate a maximum of 10 native OSS triggers with a bucket. If this limit does not meet your business requirements, you can use EventBridge-based OSS triggers, which allow you to create an additional 50 triggers. You can also apply for an increased quota for the number of event rules under a single bus on the General Quotas page to associate even more OSS triggers with a bucket.
Limits on the scaling speed of instances
Item | Limit | Adjustable or not |
Number of instances that can be delivered per minute | 300 | Yes |
Limits on layers
Item | Limit for CPU instances | Limit for GPU-accelerated instances | Adjustable or not |
Size of a layer | 500 MB | 500 MB | Yes |
Number of layer versions | 100 | 100 | No |
Total size of layers for a single function | 2 GB | 2 GB | Yes |
Limits on resources in a region within an account
Item | Limit | Adjustable or not |
Number of requests that can be concurrently processed by an instance | 1–200 | No |
Limits on accessing other Alibaba Cloud services or resources
If Function Compute in your region is enabled to access resources in Virtual Private Cloud (VPC), the following network limits apply when your function calls other Alibaba Cloud services and resources:
The function cannot access resources, such as web services and file systems, on an Elastic Compute Service (ECS) instance in the classic network by using the internal IP address of the instance. Instead, it must use the public IP address of the instance to access the resources, or migrate the resources to a VPC instance.
Similarly, the function cannot access an ApsaraDB RDS instance in the classic network by using the internal IP address of the instance. Instead, it must use the public IP address of the instance, or migrate the instance to a VPC instance.
In addition, the function cannot access an Alibaba Cloud service by using the service's internal endpoint. Instead, it must use either a VPC endpoint or a public endpoint provided by the Alibaba Cloud service.