Alibaba Cloud CDN allows you to configure bandwidth caps to prevent bandwidth spikes. This topic describes bandwidth caps and how to configure bandwidth caps.
Feature overview
A bandwidth cap specifies the maximum bandwidth value and limits the amount of bandwidth resources that can be consumed. If the average bandwidth value of a domain name in a statistical period (1 minute) reaches the specified bandwidth cap, the system suspends CDN services for the domain name and resolves the domain name to offline.***.com
. offline.***.com is considered invalid. In this case, the domain name becomes inaccessible.
- If the average bandwidth value that is measured during a statistical period is less than the specified bandwidth cap, the domain name can use CDN services as expected.
- If the bandwidth value of a domain name reaches the specified bandwidth cap due to traffic spikes, the domain name is automatically disabled and resolved to
offline.***.com
. offline.***.com is considered invalid. In this case, the domain name becomes inaccessible. - The system does not automatically restore the suspended CDN services even if the average bandwidth value drops below the specified bandwidth cap. To restore the suspended CDN services, you must log on to the Alibaba Cloud CDN console and enable the domain name. For more information, see Restore Alibaba Cloud CDN services.
Usage notes
- You cannot configure a bandwidth cap for a wildcard domain name. If you configure a bandwidth cap for a wildcard domain name, the bandwidth cap does not take effect.
- After you configure a bandwidth cap for a domain name, the domain name is automatically disabled if the average bandwidth value that is measured during a statistical period reaches the specified bandwidth cap. Before you configure a bandwidth cap for your domain name, we recommend that you estimate the maximum bandwidth value that is required by your workloads to ensure service availability.
- The monitoring data of bandwidth values may be delayed by approximately 10 minutes. Therefore, Alibaba Cloud CDN takes approximately 10 minutes to disable a domain name after the bandwidth cap set for the domain name is reached. You are charged for the traffic, bandwidth, and requests that are consumed before the domain name is disabled.
- A RAM user can configure bandwidth caps only after you grant the RAM user the required permissions.
To grant the required permissions to a RAM user, log on to the RAM console, create the AliyunCDNFullAccess policy, and then attach the policy to the RAM user.
- A bandwidth cap does not throttle bandwidth. If the average bandwidth value that is measured during a statistical period reaches the specified bandwidth cap, the domain name is automatically disabled. The bandwidth throttling feature throttles bandwidth for a domain name if the bandwidth value reaches the specified upper limit.
- You can configure bandwidth caps for up to 20 domain names in the Alibaba Cloud CDN console. One domain name can have only one bandwidth cap. If you configure bandwidth caps for more than 20 domain names after the bandwidth cap feature is enabled, the configuration results for the excess domain names are not displayed in the Alibaba Cloud CDN console. If you still want to configure bandwidth caps for the excess domain names, you must go to the Alibaba Cloud CloudMonitor console. For more information, see View or modify alert rules in CloudMonitor.
Enable or disable the bandwidth cap feature
- Log on to the Alibaba Cloud CDN console.
- In the left-side navigation pane, click Domain Names.
- On the Domain Names page, find the domain name that you want to manage and click Manage in the Actions column.
- On the Domain Names page, click the domain name that you want to manage and then click Traffic Throttling.
- Optional:The first time that you enable the bandwidth cap feature, grant CloudMonitor access permissions on Alibaba Cloud CDN.
- Click Authorize to the right of Role Authorization.
- On the Cloud Resource Access Authorization page, click Confirm Authorization Policy.
- In the Bandwidth Cap section, click Modify.
- Enable or disable the bandwidth cap feature based on your business requirements.
- Enable bandwidth cap: Turn on Bandwidth Cap and configure a bandwidth cap. Note The conversion between two neighboring data units is 1,000. For example, 1 Tbit/s is equal to 1,000 Gbit/s, and 1 Gbit/s is equal to 1,000 Mbit/s.
- Disable bandwidth cap: Turn off Bandwidth Cap.
- Enable bandwidth cap: Turn on Bandwidth Cap and configure a bandwidth cap.
- Click OK to complete the configuration.
View or modify alert rules in CloudMonitor
After you turn on Bandwidth Cap, Alibaba Cloud CDN uses the monitoring and alerting feature of CloudMonitor. An alert rule is created in CloudMonitor to monitor bandwidth values for Alibaba Cloud CDN. If the alert rule is triggered, notifications are sent to the contacts that are specified in CloudMonitor.
If you want to change the contacts or view alerts, you can perform the following operations in the CloudMonitor console:
- Log on to the CloudMonitor console.
- In the left-side navigation pane, choose .
- Change the contacts or view alerts.
- View the alert rules of a specified domain name. To query the alert rules of a specified domain name, enter the domain name that you want to query in the search box on the Alert Rules page and click the search icon.
Restore Alibaba Cloud CDN services
The system does not automatically restore the suspended Alibaba Cloud CDN services even if the average bandwidth value drops below the specified bandwidth cap. To restore the suspended Alibaba Cloud CDN services, you must log on to the Alibaba Cloud CDN console and enable the domain name. Peform the following operations:
Log on to the Alibaba Cloud CDN console and navigate to the Domain Names page. Then, select the domain name that you want to enable and click Enable in the Actions column to enable the domain name.
Billing examples
The monitoring data of bandwidth values may be delayed by approximately 10 minutes. Therefore, Alibaba Cloud CDN takes approximately 10 minutes to disable a domain name after the bandwidth cap set for the domain name is reached. You are charged for the traffic, bandwidth, and requests that are consumed before the domain name is disabled. The following examples show how resources are billed before the domain name is disabled:
Example 1: pay-by-peak-bandwidth
Customer A selects the pay-by-peak-bandwidth metering method and adds only the example.com domain name to Alibaba Cloud CDN. The bandwidth cap of the domain name is set to 10 Gbit/s.
From 21:00:00 (UTC+8) to 21:01:00 (UTC+8) on February 1, 2021, the actual bandwidth value reaches 10 Gbit/s. The domain name is disabled at 21:11:00 (UTC+8) on February 1, 2021 because the monitoring data of bandwidth values is delayed by 10 minutes. Before the domain name is disabled, the actual bandwidth value reaches 25 Gbit/s. In this case, the bandwidth fees that are included in the bill for February 1, 2021 are calculated based on the actual peak bandwidth value of 25 Gbit/s.
Example 2: pay-by-data-transfer
Customer B selects the pay-by-data-transfer metering method and adds only the example.com domain name to Alibaba Cloud CDN. The bandwidth cap of the domain name is set to 10 Gbit/s.
From 21:00:00 (UTC+8) 21:01:00 (UTC+8) on February 1, 2021, the actual bandwidth value reaches 10 Gbit/s. During the 1 minute, 30 GB of data transfer is generated. The domain name is disabled at 21:11:00 (UTC+8) on February 1, 2021 because the monitoring data of bandwidth values is delayed by 10 minutes. Before the domain name is disabled, 400 GB of data transfer is generated. In this case, the data transfer fees are included in the bill for the billing cycle from 21:00:00 (UTC+8) to 22:00:00 (UTC+8) on February 1, 2021.