Synchronous calls

更新时间:
复制 MD 格式

You can call a function synchronously. In a synchronous call, an event directly triggers the function. Function Compute runs the function and waits for a response. When the call is complete, Function Compute returns the execution results directly to you. These results include the response, an execution summary, and log output. This topic describes the scenarios and limits of synchronous calls.

Scenarios

In a synchronous call, the function processes an event and immediately returns a result. Synchronous calls are used in many scenarios, such as the following:

  • You need to view the execution result immediately.

  • The function is configured with an HTTP trigger.

Limits

By default, the total number of instances for an Alibaba Cloud account is limited to 100 in a single region. The actual limit is subject to the value displayed in the Quota Center. To increase this limit, submit a request in the Quota Center.

Note

You can monitor throttling behavior by checking the throttles metric for your function in the Cloud Monitor console.

Concurrent execution

Concurrent execution is the number of times your function code runs simultaneously. Use the following formula to estimate the number of concurrent function calls:

Number of concurrent calls = Request rate × Function running time

  • Request rate: The rate at which the function is called, measured in requests or events per second.

  • Function running time: The duration from when a request arrives at an instance until the request is completely processed, measured in seconds.

For example, a function processes Object Storage Service (OSS) events. The average running time for the function is 3 seconds. OSS publishes 10 events per second. Based on the formula, the function has 30 concurrent executions.

Note

The number of concurrent executions affects the billing for your function. For more information about billing, see Billing overview.