All Products
Search
Document Center

CDN:Configure a usage cap

Last Updated:Aug 13, 2025

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

  1. On the Domain Names page, find the domain name that you want to manage and click Manage in the Actions column.

  2. In the left-side navigation tree of the domain name, click Traffic Throttling.

  3. On the Usage Cap tab, select the cap policy that you want to configure.

  4. 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.

  5. Click OK. The rule is created and takes effect.

FAQ

Why is the actual bandwidth greater than the bandwidth cap threshold before the domain name is taken offline?

The monitoring data for domain name bandwidth has a latency of approximately 10 minutes. The domain name is taken offline approximately 10 minutes after the actual bandwidth reaches the threshold. Resource consumption, such as data transfer, bandwidth, and the number of requests, before the domain name is taken offline is billed normally. The following examples provide more details:

  • Example 1 (pay-by-peak-bandwidth):

    Customer A uses the pay-by-peak-bandwidth billing method, adds the domain name example.com, and enables the bandwidth cap feature. The bandwidth cap is set to 10 Gbps.

    From 21:00 to 21:01 on February 1, 2021, the bandwidth usage spikes to 10 Gbps. Due to monitoring data latency, the domain name is taken offline at approximately 21:11 on February 1, 2021. Before the domain name is taken offline, the peak bandwidth reaches 25 Gbps. Therefore, in the pay-by-peak-bandwidth bill generated by the system for February 1, 2021, the bill is calculated based on a peak bandwidth of 25 Gbps.

  • Example 2 (pay-by-data-transfer):

    Customer B uses the pay-by-data-transfer billing method, adds the domain name example.com, and enables the bandwidth cap feature for the domain name. The bandwidth cap is set to 10 Gbps.

    From 21:00 to 21:01 on February 1, 2021, the bandwidth usage spikes to 10 Gbps, and 30 GB of data is transferred. Due to monitoring data latency, the domain name is taken offline at approximately 21:11 on February 1, 2021. During this latency period, an additional 400 GB of data is transferred. All data transferred by example.com before it is taken offline is included in the pay-by-data-transfer bill for the 21:00 to 22:00 period on February 1, 2021.

Can I set a total bandwidth cap for all domain names under my CDN service?

No, you cannot. CDN imposes limits on individual domain names only. To set a cap for all your domain names, you must configure a cap for each domain name individually.

What if I want to limit my overall bandwidth without taking my domain offline when the cap is reached?

The bandwidth cap feature automatically takes offline a domain name when the peak bandwidth threshold is reached. If you do not want to take the domain name offline and only want to limit the maximum rate of each request, you can configure the single-request throttling feature to limit the network-wide peak bandwidth of the accelerated domain name. For more information, see Configure single-request throttling.

Can I throttle the speed for a specific IP address?

No, you cannot. The CDN bandwidth cap applies to the entire domain name. You cannot limit traffic from a specific IP address.