To prevent unexpected charges from traffic spikes or malicious attacks, you can set a usage cap. This feature limits the bandwidth, traffic, or number of HTTPS requests for an accelerated domain name, which helps you control costs and minimize losses from sudden usage surges.
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 increases dramatically in a short period due to trending topics or other events. This can cause your CDN bandwidth or traffic to significantly exceed normal levels, 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, which disrupts your operations and causes major financial losses.
To help you proactively 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 the acceleration service and prevent costs from increasing further. This feature is a key tool for CDN cost management and security.
Feature overview
The usage cap feature includes three modes: bandwidth cap, traffic cap, and HTTPS requests cap. When a rule in any of these modes is triggered, the corresponding accelerated domain name is automatically taken offline. The service resumes automatically after the specified unblocking time.
Traffic cap
This mode monitors the total traffic for a domain name over a specified period. The cap rule is triggered when the accumulated traffic exceeds the threshold you set. This feature is ideal for users with a pay-by-traffic billing model, as it helps you keep total costs within your budget.
Parameter | Description |
Statistical period | The period over which traffic usage is accumulated. The system sums the traffic within this period and compares it to the threshold. Options: Every 5 minutes, Every hour, Before midnight (resets daily at 00:00), or Monthly (resets at the end of each month). |
Threshold | The maximum total traffic allowed within one statistical period. If the accumulated traffic exceeds this threshold, the accelerated domain name is taken offline. Range: 1 MB to 10,000 TB. |
Unblocking time | The duration after which the system automatically brings the domain name back online to resume the CDN service. Options: 5 minutes, 1 hour, 1 day, 1 month, or Never (the domain name remains offline until you manually bring it back online or delete the usage cap configuration). |
Bandwidth cap
This mode monitors the peak bandwidth of a domain name. When the real-time monitored bandwidth exceeds the threshold you set, the cap rule is triggered. This feature is ideal for users with a pay-by-peak-bandwidth billing model, as it effectively controls the upper limit of your billable bandwidth.
Parameter | Description |
Threshold | The bandwidth cap for the domain name, monitored at CDN POPs. If the bandwidth within a 5-minute statistical period exceeds this threshold, the accelerated domain name is taken offline. Range: 1 Mbps to 1 Tbps. |
Unblocking time | The duration after which the system automatically brings the domain name back online to resume the CDN service. Options: 5 minutes, 1 hour, 1 day, 1 month, or Never (the domain name remains offline until you manually bring it back online or delete the usage cap configuration). |
HTTPS requests cap
This mode monitors the total number of HTTPS requests for a domain name over a specified period. The cap rule is triggered when the accumulated number of requests exceeds the threshold you set. This feature is useful for scenarios where you need to control spending on HTTPS requests within a strict budget.
Parameter | Description |
Statistical period | The period over which the number of HTTPS requests is accumulated. The system sums the requests within this period and compares the total to the threshold. Options: Every 5 minutes, Every hour, Before midnight (resets daily at 00:00), or Monthly (resets at the end of each month). |
Threshold | The maximum total number of HTTPS requests allowed within one statistical period. If the accumulated number of requests exceeds this threshold, the accelerated domain name is taken offline. Range: 1 million to 10 billion requests. |
Unblocking time | The duration after which the system automatically brings the domain name back online to resume the CDN service. Options: 5 minutes, 1 hour, 1 day, 1 month, or Never (the domain name remains offline until you manually bring it back online or delete the usage cap configuration). |
Usage notes
Monitoring data latency: Usage monitoring data has a latency of approximately 10 minutes. As a result, after the actual usage reaches the threshold, it takes about 10 minutes for the system to take the domain name offline. All resource consumption (traffic, bandwidth, requests, etc.) during this delay is billed normally.
Careful threshold evaluation: Once you configure a usage cap, the system takes your domain name offline if the threshold is reached. This disrupts all access through the CDN, causing all requests to fail. Always evaluate and set a reasonable threshold based on historical business data and future expectations to avoid impacting your normal operations.
Automatic unblocking: When a domain name is taken offline because a cap was triggered, the system starts a countdown timer based on your configured unblocking time. Even if you manually bring the domain name back online during this period, the system will automatically reactivate it when the unblocking time is reached. If you want the domain name to remain offline after the cap is triggered, you can delete the usage cap configuration to prevent the system from automatically reactivating the domain name.
Procedure
On the Domain Names page, find the target domain name and click Actions in the Manage column.
-
In the domain's navigation pane, click Traffic Throttling.
On the Usage Cap tab, select the type of cap to configure.
Click Modify Configuration and select a Statistical period, Threshold, and Unblocking time based on your business needs. For details about the parameters, see Feature overview.
Click OK. The cap rule is created and takes effect immediately.
Behavior and recovery after a domain name is taken offline due to a usage cap
When a domain name is automatically taken offline because a usage cap is triggered, you will observe the following:
The DNS resolution may point to an invalid address (such as
offline.*.kunlun*.com) or return a 614 status code, causing the website to become inaccessible.In the CDN console domain name list, the status of the domain name will be displayed as Disabled.
You can recover the domain name in one of the following ways:
Wait for automatic recovery: The system automatically starts a countdown based on your configured unblocking time. When the unblocking time is reached, the domain name is automatically brought back online.
Manually enable the domain name: If you want to restore access earlier, go to the CDN console, find the target domain name, and click the Enable button in the Actions column to bring the domain name back online.
If you want the domain name to remain offline after a cap is triggered and not be automatically brought back online, delete the usage cap configuration.
Delete a usage cap configuration
To completely remove a usage cap rule and stop it from taking effect, you must delete the configuration rather than simply turning off the switch.
On the Domain Names page, find the target domain name and click Manage in the Actions column.
On the Usage Cap tab, locate the cap configuration that you want to remove (Bandwidth Cap, traffic Cap, or HTTPS Requests Cap).
Click Delete Configuration.
In the confirmation dialog box, click OK.
After the configuration is deleted, the corresponding usage cap rule is permanently removed and the system no longer monitors or enforces the threshold for that cap type. If you turn off the switch without deleting the configuration, the usage cap policy may still take effect.