All Products
Search
Document Center

Function Compute:Synchronous invocation

Last Updated:Feb 02, 2024

A synchronous invocation is a method to invoke functions. When you synchronously invoke a function, an event directly triggers the function, and Function Compute executes the function and waits for a response. After the function is invoked, Function Compute returns the execution details of the function, such as execution results, execution summary, and logs. This topic describes the scenarios and limits of synchronous invocations.

Scenarios

During a synchronous invocation, results are directly returned after an event is processed by a function. Synchronous invocations are applicable to a wide range of scenarios, including but not limited to the following scenarios:

  • The results of a function execution must be viewed at the earliest opportunity.

  • The function that you want to invoke is configured with an HTTP trigger.

Limits

Resource limits for function execution: By default, the maximum number of on-demand instances available for your Alibaba Cloud account in a single region is 300.

Note

You can use the throttling metric of functions to observe throttling behaviors in the CloudMonitor console. If you want to increase the upper limit, join the DingTalk group (ID: 11721331) for technical support.

Execution concurrency

Execution concurrency is the number of concurrent invocations of a function in a period of time. You can use the following formula to estimate execution concurrency:

Execution concurrency = Request rate × Function execution duration

  • The request rate is the number of requests or events per second for a function.

  • The function execution duration starts when a request arrives at the instance and ends when the request is completely executed, in seconds.

For example, you have a function that processes Object Storage Service (OSS) events. The average execution duration for the function is 3 seconds, and 10 OSS events are generated per second. You can use the formula to calculate that the execution concurrency for your function is 30.

Note

Execution concurrency affects billing on your functions. For more information about billing, see Billing overview.