Configure a usage cap to limit the bandwidth, traffic, or HTTPS requests for an accelerated domain name. This prevents unexpected charges caused by traffic spikes or malicious attacks.
Background
When you use Alibaba Cloud CDN to accelerate your services, you may encounter the following issues:
Sudden traffic surges: Your website or application traffic can spike due to trending topics or other events, causing CDN bandwidth or traffic to far exceed normal levels and resulting in high costs.
Malicious traffic attacks: Your services are targeted by a CC attack or DDoS attack. Attackers generate a massive volume of requests or consume significant bandwidth, disrupting your operations and causing major financial losses.
To help you control costs and manage risks, Alibaba Cloud CDN provides the usage cap feature. You can set a threshold for the bandwidth, traffic, or number of HTTPS requests for an accelerated domain name. When usage in a statistical period reaches your configured threshold, CDN automatically takes the domain name offline to suspend acceleration and prevent further costs.
Feature overview
The usage cap feature includes three modes: bandwidth cap, traffic cap, and HTTPS requests cap. When a cap rule is triggered, the domain name is automatically taken offline. The service resumes after the specified unblocking time.
Traffic cap
Monitors accumulated traffic for a domain name over a specified period. The cap is triggered when the total traffic exceeds your threshold. This mode is ideal for the pay-by-traffic billing model.
Parameter | Description |
Statistical period | The period over which traffic usage is accumulated and compared with the threshold. Valid values: Every 5 minutes, Every hour, Before 24:00 of the current day, or This month. |
Threshold | The maximum total traffic allowed within one statistical period. If the accumulated traffic exceeds this threshold, the domain name is taken offline. Value range: 1 MB to 10,000 TB. |
Unblocking time | The wait time before the domain name is automatically brought back online after the cap is triggered. |
Bandwidth cap
Monitors the bandwidth of a domain name. The cap is triggered when bandwidth exceeds your threshold. This mode is ideal for the pay-by-peak-bandwidth billing model, as it controls the upper limit of your billable bandwidth.
Parameter | Description |
Threshold | The bandwidth cap for the domain name. If the bandwidth within a statistical period exceeds this threshold, the domain name is taken offline. Value range: 1 Mbit/s to 1 Tbit/s. |
Unblocking time | The wait time before the domain name is automatically brought back online after the cap is triggered. Valid values: 5 minutes, 1 hour, 1 day, 1 month, or Never. |
HTTPS requests cap
Monitors the accumulated number of HTTPS requests for a domain name over a specified period. The cap is triggered when the total requests exceed your threshold. This mode is useful for controlling HTTPS request costs within a fixed budget.
Parameter | Description |
Statistical period | The period over which the number of HTTPS requests is accumulated and compared with the threshold. Valid values: Every 5 minutes, Every hour, Before 24:00 of the current day, or This month. |
Threshold | The maximum total number of HTTPS requests allowed within one statistical period. If the accumulated requests exceed this threshold, the domain name is taken offline. Value range: 1 million to 10 billion requests. |
Unblocking time | The wait time before the domain name is automatically brought back online after the cap is triggered. |
Usage notes
Monitoring data latency: Usage monitoring data has a latency of about 10 minutes. The system takes the domain name offline about 10 minutes after usage reaches the threshold. You are billed for all traffic, bandwidth, and requests consumed during this delay.
Careful threshold evaluation: When a usage cap is triggered, the domain name goes offline and all CDN requests fail. To avoid disrupting normal operations, set a reasonable threshold based on historical usage data and expected growth.
Automatic unblocking logic: After a domain name is taken offline by a usage cap, the system starts a countdown based on the unblocking time you configured. The system brings the domain name back online when the countdown ends, even if you manually brought it online earlier. To keep the domain name offline permanently after a cap is triggered, delete the usage cap configuration.
Deleting a configuration vs. disabling the switch: A usage cap policy remains active as long as its configuration record exists. Disabling the switch does not stop the policy from being enforced. To completely remove a usage limit, go to the usage cap configuration page and delete the corresponding configuration.
Procedure
On the Domain Names page, find the domain name that you want to manage and click Manage in the Actions column.
-
In the domain's navigation pane, click Traffic Throttling.
On the Usage Cap tab, select the cap policy that you want to configure.
Click Modify Configuration and select a suitable statistical period, threshold, and unblocking time. For more information about the parameters, see Feature overview.
Click OK. The cap rule is created and takes effect immediately.
To delete an existing cap configuration, on the Usage cap tab, find the cap policy (Traffic Cap, Bandwidth Cap, or HTTPS Requests Cap) that you want to remove and click Delete. In the confirmation dialog box, click OK. The cap configuration is then deleted, and the system no longer enforces a limit for that usage metric.
You must delete the corresponding cap configuration record to ensure the usage limit is completely removed.
Offline behavior and recovery
When a domain name is taken offline because a usage cap is triggered:
DNS resolution for the domain name may point to an invalid address, such as
offline.*.kunlun*.com, or return a614status code. As a result, your website becomes inaccessible.In the list of domain names in the CDN console, the status of the domain name changes to Disabled.
You can restore the service in either of the following ways:
Wait for automatic recovery: The system starts a countdown based on your configured unblocking time. The domain name is brought back online when the countdown ends.
Manually enable the domain name: To restore service sooner, find the domain name in the CDN console and click the Actions button in the Actions column.
If you want the domain name to remain offline after a cap is triggered, delete the usage cap configuration.

