Synchronous invocations are an invocation method for 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 the result, execution summary, and logs. This topic describes the scenarios and limits of synchronous invocations.

Scenarios

During a synchronous invocation, the result is 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 execution result must be viewed at the earliest opportunity.
  • The function to be invoked is configured with an HTTP trigger.

Limits

Resource limits for function execution: 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 metric of functions to observe throttling behaviors in the CloudMonitor console. If you want to increase the upper limit, join the DingTalk group 11721331 to contact the technical support.

Execution concurrency

Execution concurrency is the number of concurrent invocations of a function in a specified period of time. You can use the following formula to estimate the 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 for your functions. For more information, see Billing overview.