This topic describes limits on usage of Function Compute resources, such as service resources, function execution resources, triggers, layers, regions, image, and the number of GPU cards.
This topic helps new users gain a clear understanding of function principles and prevent unexpected costs incurred due to incorrect configurations or code errors, such as cyclical invocations and infinite loops. If you understand function principles and want to increase the limits of specific resources based on your business requirements, join the DingTalk group 64970014484 for technical support. Only resources whose limits are adjustable can be adjusted.
Even if limits are imposed on resources, unexpected cost surges may still occur due to improper use of the provisioned mode. For more information, see Instance types and usage modes.
Limits on function resources
Item | Upper limit | Adjustable |
Triggers per function | 50 | Yes |
File Storage NAS (NAS) mount targets per function | 5 | No |
Object Storage Service (OSS) mount targets per function | 5 | No |
Limits on function execution resources
Item | Upper limit for CPU instances | Upper limit for GPU-accelerated instances | Adjustable |
Temporary disk space | 10 GB | 10 GB | No |
File descriptors | 100,000 | 100,000 | No |
Total processes and threads | 1,024 | 1,024 | No |
Memory for a function | 32 GB | 32 GB | No |
Function execution duration | 86,400s | 86,400s | No |
Execution duration for an Initializer hook | 300s | 300s | No |
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 |
Size of a code package (Base64-encoded ZIP file uploaded through an SDK or API operation) | 100 MB | N/A | Yes |
Size of a code package (ZIP/JAR file uploaded through the Function Compute console, a developer tool, or OSS) | 500 MB | N/A | Yes |
Image size before decompression | 10 GB | 15 GB | Yes |
Bandwidth | 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 |
Limits on code packages
When you create or update a function in Function Compute, you need to upload a code package. The limits on the sizes of code packages vary based on the upload method you choose.
Code packages uploaded through SDKs or API operations
The size of a code package uploaded by using an SDK cannot exceed 100 MB. ZIP files uploaded by using SDKs must be Base64-encoded. The encoding process increases the sizes of the original code packages. In addition to code packages, request bodies that are used to create and update functions also contain other content, such as function configurations. Make sure that the total size of the Base64-encoded code package and other content in the request body is less than 100 MB.
Code packages uploaded by using the Function Compute console, developer tools, or OSS
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.
Limits on triggers
Item | Upper limit | Adjustable |
Number of native OSS triggers that can be created for a bucket | 10 | No |
Number of EventBridge-based OSS triggers that can be created for a bucket | 50 | Yes |
Limits on layers
Item | Upper limit for CPU instances | Upper limit for GPU-accelerated instances | Adjustable |
Layer size | 500 MB | 500 MB | Yes |
Layer versions | 100 | 100 | Yes |
Layers of a single function | 5 | 5 | Yes |
Total size of layers of a single function | 2 GB | 2 GB | Yes |
Limits on resources for an account per region
Item | Upper limit | Adjustable |
Instances | 300 | Yes |
Instance concurrency | 200 | No |
Limits on sizes of instance images
Instance type | Upper limit for image size | Adjustable |
CPU instances | 10 GB after compression (approximately 20 GB before compression for a Docker image) | Yes |
GPU-accelerated instances | 15 GB after compression (approximately 28 GB before compression for a Docker image) | Yes |
Limits on GPU cards
Item | Upper limit | Adjustable |
Physical GPU cards per region Note Types of GPU cards for GPU-accelerated instances include Tesla series, Ampere series, and Ada series. | 30 | Yes |
Limits on accessing other Alibaba Cloud services or resources
If Function Compute in your region is enabled to access resources in virtual private clouds (VPCs), the following limits on networks apply when your function calls other Alibaba Cloud services and resources:
You cannot access resources, such as web services and file systems, on an Elastic Compute Service (ECS) instance by using the internal IP address of the instance in the classic network. You can use the public IP address of the instance to access the resources or migrate the resources to a VPC.
You cannot use an internal IP address in the classic network to access an ApsaraDB RDS instance. You can use a public IP address or migrate the ApsaraDB RDS instance to a VPC.
You cannot access an Alibaba Cloud service by using an internal endpoint. You can use a VPC endpoint or a public endpoint that is provided by the Alibaba Cloud service.