All Products
Search
Document Center

Function Compute (2.0):Usage limits

Last Updated:Jul 15, 2024

This topic describes limits on usage of Function Compute resources, such as service resources, function resources, triggers, layers, regions, images, and GPU cards.

Important

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 service resources

Item

Limit

Adjustable

Functions per service

50

Yes

Apsara file storage NAS (NAS) mount targets per service

5

No

Object Storage Service (OSS) mount targets per service

5

No

Limits on function execution resources

Item

Upper limit for elastic 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 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

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

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

Limit

Adjustable

Triggers per function

10

Yes

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 elastic instances

Upper limit for GPU-accelerated instances

Adjustable

Size of a layer

500 MB

500 MB

Yes

Number of layer versions

100

100

Yes

Number of layers for 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

Limit

Adjustable

On-demand instances

300

Yes

Instance concurrency

1 to 200

No

Limits on sizes of instance images

Item

Limit

Adjustable

Size of a CPU image

10 GB after compression (approximately 20 GB before compression for a Docker image)

Yes

GPU image size

15 GB after compression (approximately 28 GB before compression for a Docker image)

Yes

Limits on GPU cards

Item

Limit

Adjustable

Physical GPU cards per region

Note

GPU-accelerated instances in Function Compute can be configured with GPU cards of the Tesla T4 or Ampere A10 type.

30

Yes

Relationship between GPU card types and instance concurrency

  • Tesla T4 card with 2 GB of GPU memory: Each card can simultaneously carry 8 GPU containers, and a total of 240 GPU containers can be simultaneously carried at the region level.

    • If the instance concurrency of a GPU function is 1, the inference concurrency of the function in a region is 240.

    • If the instance concurrency of a GPU function is 5, the inference concurrency of the function in a region is 1,200.

  • Ampere A10 card with 2 GB of GPU memory: Each card can simultaneously carry 12 GPU containers, and a total of 360 GPU containers can be simultaneously carried at the region level.

    • If the instance concurrency of a GPU function is 1, the inference concurrency of the function in the region is 360.

    • If the instance concurrency of a GPU function instance is 5, the inference concurrency of the function in the region is 1,800.

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 cloud services or 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 a 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 a classic network to access an ApsaraDB RDS instance. You must use a public IP address or migrate the ApsaraDB RDS instance to a VPC.

  • You cannot access an Alibaba Cloud service by using its internal endpoints. You must use a VPC endpoint or a public endpoint that is provided by the Alibaba Cloud service.