To prevent high bills from bandwidth spikes caused by attacks or unauthorized usage, you can configure a usage cap. This feature lets you control the maximum bandwidth, data transfer, and number of HTTPS requests for an accelerated domain, helping you reduce losses from unexpected traffic surges.
Why use it
When you use CDN to accelerate your services, you may face these situations:
Traffic spikes: Website or app visits may suddenly increase due to social trends or events. This can cause your CDN bandwidth or data usage to soar, resulting in higher fees.
Malicious attacks: Your service is targeted by a DDoS or other attack. Attackers generate a massive number of requests or consume huge amounts of bandwidth in a short period, disrupting your business and causing financial losses.
To proactively manage costs and mitigate these risks, you can use the usage cap feature.
What is usage cap
The usage cap feature includes three options: bandwidth cap, traffic cap, and HTTPS requests cap. When any rule is triggered, the corresponding accelerated domain name is automatically taken offline. The service is automatically resumed after the preset unblocking time is reached.
Traffic cap
This feature calculates the total data transfer of a domain name within a specified period. When the accumulated data transfer exceeds the configured threshold, the cap rule is triggered. This feature is suitable for users who are billed on a pay-by-traffic basis. It helps you control total costs and stay within your budget.
Parameter | Description |
Statistical Period | The statistical period for accumulating data transfer usage. The system accumulates data transfer within this period and compares it with the threshold. |
Threshold | The maximum total data transfer allowed within a statistical period. When the accumulated data transfer exceeds this threshold, the accelerated domain name is taken offline. Valid values: 1 MB to 10,000 TB. |
Unblocking Time | After the domain name is taken offline, the system starts a timer from the moment the rule is triggered. When the unblocking time that you set is reached, the domain name is automatically reactivaed, and the acceleration is resumed. |
Bandwidth cap
This feature monitors the peak bandwidth of a domain name during a service period. When the real-time monitored bandwidth exceeds the configured threshold, the cap rule is triggered. This feature is especially suitable for users who are billed on a pay-by-peak-bandwidth basis. It effectively controls the maximum billable bandwidth.
Parameter name | Parameter description |
Threshold | The peak outbound bandwidth of the domain name monitored by CDN points of presence (POPs). When the peak bandwidth exceeds this threshold, the accelerated domain name is taken offline. Valid values: 1 Mbps to 1 Tbps. |
Unblocking Time | After the domain name is taken offline, the system starts a timer from the moment the rule is triggered. When the unblocking time that you set is reached, the domain name is automatically reactivaed, and the acceleration is resumed. |
HTTPS request cap
This feature calculates the total number of HTTPS requests for a domain name within a specified period. When the accumulated number of requests exceeds the configured threshold, the cap rule is triggered. This feature is suitable for business scenarios that require strict budget control over the number of HTTPS requests.
Parameter name | Parameter description |
Statistical Period | The statistical period for accumulating the number of HTTPS requests. The system accumulates the number of requests within this period and compares it with the threshold. |
Threshold | The maximum total number of HTTPS requests allowed within a statistical period. When the accumulated number of requests exceeds this threshold, the accelerated domain name is taken offline. Valid values: 1 million to 10 billion. |
Unblock Time | After the domain name is taken offline, the system starts a timer from the moment the rule is triggered. When the unblocking time that you set is reached, the domain name is automatically reactivaed, and the CDN acceleration service is resumed. |
Before you begin
Data monitoring latency: Usage monitoring data has a latency of approximately 10 minutes. After your usage reaches the threshold, the system takes around 10 minutes to take the domain offline. During this delay, resource usage such as data transfer, bandwidth, and requests is billed as usual.
Careful threshold assessment: After you configure a usage cap, if the threshold is reached, your domain name will be taken offline. This interrupts access through CDN and causes all requests to fail. You must carefully assess the threshold based on historical service data and future expectations to avoid services disruption.
Automatic unblocking logic: After a domain name is taken offline because the usage cap is triggered, the system automatically starts a reactivation timer based on the configured Unblocking Time.
Manually reactivating the domain during this period does not stop the timer. The system will still attempt to reactivate the domain when the timer ends.
To keep the domain offline after the cap is triggered, you must delete the usage cap configuration. This prevents the system from automatically bringing the domain back online.
Setup
On the Domain Names page, find the domain name that you want to manage and click Manage in the Actions column.
In the left-side navigation tree of the domain name, click Traffic Throttling.
On the Usage Cap tab, select the cap policy that you want to configure.
Click Configure. Select a suitable Statistical Period, Cap, and Unblocking Time based on your needs. For more information about the parameters, see What is usage cap.
Click OK. The rule is created and takes effect.