All Products
Search
Document Center

Function Compute:Specify the maximum number of concurrent instances

Last Updated:Apr 08, 2024

Alibaba Cloud Function Compute allows each account to run a maximum of 300 function instances concurrently in each region to prevent unexpected costs caused by excessive function invocations. Also, Function Compute allows you to specify an upper limit for the number of instances for a function so that the function is not overly invoked. This protects backend resources and prevents unexpected costs generated by a large number of instances.

Scenarios

  • Ensure concurrency requirements of key functions

    For example, function-a and function-b share an account-level instance limit. function-a is a key function and its normal running must be guaranteed. Execution of requests by function-a may be affected if function-b is overly invoked. In this case, you can specify an instance limit for function-b to prevent function-b from preempting a large number of instances and ensure that enough instances are allocated to function-a. You can also specify a concurrency value for function-a to ensure that a specified number of instances are guaranteed for function-a.

  • Protect downstream services

    For example, if your functions need to make a large number of access requests to ApsaraDB RDS, you can specify a maximum number of instances for the functions to ensure that ApsaraDB RDS is not overwhelmed.

  • Prohibit abnormal function invocations

    For example, you can prohibit invocations of a function by settings the maximum number of instances for the function to 0 if invocations of the function are abnormal.

  • Prevent unexpected function invocations

    You can set the maximum number of instances for a function to prevent unexpected invocations initiated from browsers and clients.

Limits

  • Each Alibaba Cloud account can concurrently run up to 300 function instances in each region. Provisioned instances and on-demand instances of the account share the limit.

    Note

    If you want to increase the upper limit, join the DingTalk group 11721331 for technical support.

  • The maximum number of concurrent instances that you can specify for a function is 90% of the region limit. The maximum total number of concurrent instances that can be set for all functions in a region is also 90% of the region limit.

    For example, if the maximum number of concurrent instances for an account in a region is 300, the maximum number of concurrent instances that can be configured for a function is 270. If you set the maximum number of concurrent instances for a function to 100, the total number of concurrent instances that can be set for other functions in the region cannot exceed 170.

Procedure

You can use one of the following methods to configure the maximum number of concurrent instances.

Use the Quota Center tab

  1. Log on to the Function Compute console. In the left-side navigation pane, click Functions.

  2. In the top navigation bar, select a region. On the Functions page, click the function that you want to manage.

  3. Click the Quota Center tab and click Modify.

  4. In the Edit Concurrent Instance Limit panel, enter the maximum number of concurrent instances and click OK.

Use the Auto Scaling tab

  1. Log on to the Function Compute console. In the left-side navigation pane, choose Advanced Features > Auto Scaling.

  2. In the top navigation bar, select a region and click the Maximum Concurrent Instances tab.

  3. Click Configure Concurrent Instance Limit.

  4. In the Configure Concurrent Instance Limit panel, select the function that you want to manage, enter the maximum number of concurrent instances, and then click OK.

References