All Products
Search
Document Center

Function Compute:Synchronous invocation

Last Updated:Sep 24, 2024

Functions can be invoked in synchronous mode. If you invoke a function in synchronous mode, an event directly triggers the function, and Function Compute executes the function and waits for a response. After the function is invoked, Function Compute directly returns the execution details, such as execution results, execution summary, and logs. This topic describes the scenarios and limits of synchronous invocations.

Scenarios

Use synchronous invocations if you need to immediately execute a function and directly return the results.

Limits

By default, the maximum number of on-demand instances allowed for your Alibaba Cloud account in each region is 300.

Note

You can use the throttling metrics of functions to observe throttling behaviors in the CloudMonitor console. If you need to increase this limit, join the DingTalk group 64970014484 for technical support.

Execution concurrency

Execution concurrency indicates 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. The execution concurrency for your function is 30.

Note

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