If you worry about high fees incurred by high bandwidth or traffic usage due to hotlinking by malicious users, you can use the usage limit feature to control the usage.
When the bandwidth or traffic usage during a statistical period exceeds the configured alarm threshold, CDN will push a message notification to you; when the bandwidth cap is exceeded, you can disable CDN to avoid incurring more CDN service fees.
It will take about ten minutes for the usage limit configuration to take effect, during which the usage will be normally billed. For more information, see Attack Prevention Solutions.
Log in to the CDN console, select Domain Management on the left sidebar, and click Manage on the right of a domain name to enter its configuration page. You will find the Usage Limit Configuration on the Advanced Configuration tab, which is disabled by default.
Toggle the switch on and configure the items:
Cumulative usage limit configuration is not supported for domain names with the acceleration type of dynamic content or dynamic & static content.
- A statistical period starts from 5 minutes before the configuration time:
For example, if the rule is configured during 09:05:01–09:09:59, the statistical period will start from 09:05:00.
- If Per hour is selected as the statistical period, (1) the first statistical period will be less than one hour; (2) starting from the next statistical period, usage statistics will be collected once every hour.
For example, if the rule is configured at 09:23:10 on January 13, 2022, the first statistical period will be 9:20:00–9:59:59, and the next one will be 10:00:00–10:59:59.
- If Before 24:00 of the day is selected as the statistical period, the statistical period will be 09:20:00–23:59:59 on January 13, 2022.
ex.comis set to return 404 (CDN is disabled) after the limit is exceeded, and the automatic unblocking period is set to 60 minutes, then after the configured cumulative usage limit is exceeded, CDN will be disabled, and the acceleration domain name will be deactivated and will be automatically unblocked after 60 minutes.
- If the detected domain name bandwidth (traffic) exceeds the threshold, the Return 404 configuration needs to be delivered node by node across the entire network; therefore, there will be a certain delay for the configuration to take effect.
- If the alarm threshold is enabled, as the scan interval is five minutes, if the usage surges or the configured percentage value is large, it may happen that the alarm threshold is not triggered during the previous scan, and the bandwidth cap is directly reached during the next scan. In this case, CDN will send alarm notifications of the percentage and the bandwidth cap successively.
If your acceleration domain name is configured for global acceleration and you want to configure different usage limits for acceleration in and outside the Chinese mainland, you can click Add Special Configuration.
- Currently, an added region-specific configuration can only be disabled but not deleted.
- Region-specific configuration is not supported for domain names with the acceleration type of dynamic content or dynamic & static content.
Suppose the domain name
cloud.tencent.com is configured for global acceleration, and a region-specific usage limit configuration (for regions outside the Chinese mainland) is added as follows:
You can toggle off the usage limit feature. Then, even if there is existing configuration at the bottom, it will not take effect in the production environment. If you toggle the switch on, a message will be displayed asking you whether to enable this feature before the configuration takes effect across the entire network.