Usage Cap
You can set a traffic or bandwidth cap for a domain name. When the usage reaches the cap, CDN acceleration will be disabled for the domain name, reducing high bills caused by traffic theft or attacks.
Scenarios
If your domain name is attacked or has malicious traffic coming, there may be sudden traffic spikes that result in a bill higher than your normal expenditures. In this case, you can enable usage cap. Once the consumed bandwidth or traffic reaches the cap in a specified period, CDN acceleration will be disabled for this domain name.
Precautions
- Statistics data has a delay of about 10 minutes. When your domain name reaches the cap, CDN acceleration will be disabled about 10 minutes later. The traffic, bandwidth, and number of requests generated during this time are charged.
- When CDN acceleration is disabled for your domain name, the domain name cannot be accessed (status code 403 is returned). Set a proper usage cap to prevent service loss.
- After CDN acceleration is disabled for a domain name, the CNAME record will be deleted. If the local DNS has a resolution cache or a user binds the domain name with a CDN PoP in the hosts file to forcibly resolve requests, CDN will refuse to provide services after receiving the requests. However, traffic and request data will be generated. You need to pay for the traffic and request data.
- Exercise caution when setting a usage cap for a wildcard domain name (for example, *.test.com). The total usage of all subdomain names, such as a.test.com, b.test.com, and c.test.com, is collected. Once the total usage reaches the cap, CDN acceleration is disabled for the wildcard domain name and all subdomain names become inaccessible.
- You can set usage caps for up to 20 domain names. Each domain name can have only one bandwidth cap rule.
- You cannot set usage caps for domain names with special configurations.
- When a domain name reaches the usage cap and CDN is disabled, usage capping will be executed again during the current statistical period. For example:
- On October 19, 2023, a customer set a traffic cap rule, that is, when the accumulated traffic usage within an hour reaches 400 GB, CDN acceleration will be disabled for 1 hour. From 20:00 to 20:35 on October 25, 2023, the traffic suddenly increased to 400 GB. Due to a delay in monitoring data, CDN acceleration was disabled for this domain name at about 20:41 on October 25, 2023. In this case, usage capping was not executed again from 20:41 to 20:59:59.
- When the bandwidth or traffic cap is reached, CDN delivers the settings of returning the status code 403 to all PoPs. In this case, there is a delay between the cap being reached and the status code being returned to users.
- Usage capping is free of charge on CDN. Simple Message Notification (SMN) charges you for alarm notifications sent to you. For details about SMN pricing, see SMN Pricing Details.
Procedure
-
Log in to Huawei Cloud console. Choose .
The CDN console is displayed.
- In the navigation pane, choose .
- In the domain list, click the target domain name or click Configure in the Operation column.
- Click the Advanced Settings tab and enable the switch next to Usage Cap.
Figure 1 Setting the usage cap
Table 1 Parameters Parameter
Description
Example
Statistics Type
Real-time usage: Collects the traffic/bandwidth statistics every 5 minutes.- The start time of a statistical period is a multiple of 5 minutes. For example, if a rule is configured at a time from 00:10:01 to 00:14:59, the start time of the first statistical period is 00:10:00 (rounding down to the nearest 5 minutes).
Accumulated usage/hour: Collects statistics on the traffic accumulated every exact hour. For example, the first statistical period on October 19, 2023 is 00:00:00 to 00:59:59.
- After a usage cap is set, the first statistical period may be less than one hour. For example, if the usage cap is set at 00:25:00 on October 19, 2023, the usage from 00:25:00 to 00:59:59 is collected in the first statistical period.
Accumulated usage/day: Collects statistics on the traffic accumulated every day (UTC+08:00). For example, the statistical period on Oct 19, 2023 is 00:00:00 to 23:59:59.
Real-time usage
Usage Cap
For real-time usage, you can set a traffic or bandwidth cap. For accumulated usage, you can only set a traffic cap.
Bandwidth cap: Collects bandwidth usage every 5 minutes. You can set a bandwidth cap as required.
Traffic cap: Collects traffic usage in the specified period. You can set a traffic cap as required.
NOTE:The bandwidth and traffic conversion rules for usage capping are the same as those for billing. The default conversion rules are: 1 GB = 1,024 MB and 1 Gbit/s = 1,000 Mbit/s.
Bandwidth cap
10 Gbit/s
Alarm Threshold
When the ratio of the access traffic/bandwidth to the configured cap reaches the alarm threshold, CDN sends a message to you. The alarm threshold ranges from 10% to 90%.
- Alarms are sent to the mobile number and email address bound to your account through SMS messages and emails. For details about how to change the mobile number and email address, see Binding or Changing the Service Mobile Number and Changing the Service Email Address.
80%
Unblock After
Duration for disabling CDN after the bandwidth or traffic cap is reached. After the specified duration expires, CDN is automatically enabled for the domain name.
- Select 60 minutes, 12 hours, 24 hours, 3 days, or Manually. If you select Manually, you need to enable CDN for the domain name on the console if you want to use it again after it is blocked.
12 hours
- Set required parameters and click OK.
Fee Description
The monitoring data has a delay of about 10 minutes. After the actual usage reaches the cap, CDN acceleration will be disabled about 10 minutes later. The traffic and bandwidth generated during this period are charged.
- Example 1 (billing by peak bandwidth):
Customer A is billed by peak bandwidth. This customer added domain name example.com to CDN, enabled a bandwidth cap, and set the cap to 15 Gbit/s.
The bandwidth suddenly increased to 15 Gbit/s from 22:00 to 22:05 on October 10, 2023. Due to the monitoring data delay, CDN acceleration was disabled at about 22:11 on the same day and the peak bandwidth reached 23 Gbit/s. In this case, 23 Gbit/s bandwidth was charged in the bill for peak bandwidth generated on October 10, 2023.
- Example 2 (billing by traffic):
Customer B is billed by traffic. This customer added domain name example.com to CDN, enabled a traffic cap, and set the cap to 400 GB.
From 22:00 to 22:05 on October 10, 2023, the traffic usage surged to 400 GB. Due to the monitoring data delay, CDN acceleration was disabled at about 22:11 on October 10, 2023. The traffic usage during this time reached 550 GB. Any traffic generated before CDN acceleration was disabled was included in the bill of 22:00 to 23:00 on October 10, 2023.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot