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, an Alibaba Cloud account can concurrently run at most 100 instances in a region. The actual limit in Quota Center prevails. If you want to increase the limit, go to the Quota Center to apply for a quota increase.
You can use the throttling metrics of functions to observe throttling behaviors in the CloudMonitor console.
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.
Execution concurrency affects billing on your functions. For more information about billing, see Billing overview.