To ensure the stability of Alibaba Cloud services and the fair use of cloud resources, Elastic Compute Service (ECS) throttles API requests. This topic describes how to view the throttling information of ECS API requests and provides suggestions on how to throttle API requests.
Throttling is enabled for all ECS API operations to throttle requests. Region-specific throttling thresholds are set for different API operations. Access traffic generated by calls to a specified API operation in a single region within the same Alibaba Cloud account cannot exceed the system-defined throttling threshold. Otherwise, API requests initiated within a specific unit of time during the throttling period are denied by the system.
Access traffic includes data traffic from the ECS console, Resource Access Management (RAM) users, self-managed platforms based on Alibaba Cloud accounts, and Infrastructure as a Service (Iaas) orchestration platforms such as Terraform and Ansible.
- Traffic generated by calls to each API operation is independently calculated. If traffic on a single API operation within a region reaches the throttling threshold, calls to other API operations and calls to this API operation in other regions are not affected.
- If an API operation is throttled at minute T, the operation can continue to be called as of minute T+1.
- If an API operation is throttled and an error is reported when the API operation is called by using an SDK or Alibaba Cloud CLI, the corresponding features are also throttled in the operations performed in the ECS console.
- Request aggregation
Some ECS API operations can be called to batch query or perform batch operations on resources. We recommend that you call these API operations to query multiple resources or perform operations on multiple resources at a time.
- Fixed call frequency
If you want to call API operations to check the states of resources, we recommend that you call API operations at a specified interval or by using the reverse backoff mechanism. Examples:
- In most cases, the interval at which resource states (such as Starting and Stopping) are checked is 1 to 2 seconds.
- In the reverse backoff mechanism, you do not check the state of a resource for several seconds after operations are performed on the resource, and then gradually increase the check frequency until a fixed interval of 1 to 2 seconds is reached.
- Backoff retry policy
If an error code is returned due to throttling when you call an API operation, you must configure a backoff retry policy for requests of the API operation. When you retry an API operation within the same Alibaba Cloud account, you can perform one query per second (QPS) to check whether the API operation is available.