Alibaba Cloud CDN allows you to set a bandwidth cap to prevent bandwidth spikes. This topic introduces bandwidth caps and describes how to set a bandwidth cap.

Overview

A bandwidth cap specifies a maximum bandwidth value, which limits the amount of bandwidth resources that can be consumed. If the average bandwidth value of an accelerated domain name within a statistical period (1 minute) reaches the specified bandwidth cap, Alibaba Cloud CDN suspends acceleration for the domain name and maps the domain name to the invalid domain name offline.***.com. In this case, the accelerated domain name becomes inaccessible.

  • If the average bandwidth value measured during a statistical cycle is lower than the specified bandwidth cap, the domain name can use CDN services as expected.
  • If the bandwidth value of an accelerated domain name reaches the specified bandwidth cap due to traffic spikes, the accelerated domain name is automatically disabled and mapped to the invalid domain name offline.***.com. In this case, the accelerated domain name becomes inaccessible.
  • Alibaba Cloud CDN does not automatically restore the suspended services even if the average bandwidth value drops below the specified bandwidth cap. To restore the suspended services, you must log on to the Alibaba Cloud CDN console and enable the domain name. For more information, see Restore CDN services.

Usage notes

  • You cannot set a bandwidth cap for a wildcard domain name. If you set a bandwidth cap for a wildcard domain name, the bandwidth cap does not take effect.
  • After you set a bandwidth cap for a domain name, the domain name is disabled if the average bandwidth value measured during a statistical period reaches the specified bandwidth cap. We recommend that you estimate the maximum bandwidth value required by your workloads before you set a bandwidth cap for your domain name. This ensures service availability. Proceed with caution.
  • The monitoring data of bandwidth values may be delayed by a short period of time. A domain name is disabled about 10 minutes after the bandwidth cap set for the domain name is reached. A domain name can be disabled only once within an hour.
  • To allow a Resource Access Management (RAM) user to set bandwidth caps, you must grant the RAM user the required permissions.

    To grant permissions to a RAM user, you can log on to the RAM console, create the AliyunCDNFullAccess permission policy, and then attach this policy to the RAM user.

  • A bandwidth cap does not throttle bandwidth. If the average bandwidth value measured during a statistical period reaches the specified bandwidth cap, the domain name is automatically disabled. However, the bandwidth throttling feature throttles bandwidth for a domain name if its bandwidth value reaches the specified upper limit.

Caution

The monitoring data of bandwidth values may be delayed by about 10 minutes. Therefore, it takes about 10 minutes for Alibaba Cloud CDN to disable a domain name after the bandwidth cap set for the domain name is reached. During this period of time, you are charged for the bandwidth resources that are consumed. The following examples show how bandwidth resources are billed during this period of time:

  • Example 1: pay-by-peak-bandwidth

    Alice chooses the pay-by-peak-bandwidth metering method and adds only the domain name example.com to Alibaba Cloud CDN. The bandwidth cap of the domain name is set to 10 Gbit/s.

    From 21:00:00 (UTC+8) on February 1, 2021 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 a short period of time. 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 generated on February 1, 2021 are calculated based on the actual peak bandwidth value, which is 25 Gbit/s.

  • Example 2: pay-by-data-transfer

    Tom chooses the pay-by-data-transfer metering method and adds only the domain name example.com to Alibaba Cloud CDN. The bandwidth cap of the domain name is set to 10 Gbit/s.

    From 21:00:00 (UTC+8) on February 1, 2021 to 21:01:00 (UTC+8) on February 1, 2021, the actual bandwidth value reaches 10 Gbit/s. During this period of time, 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 a short period of time. 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 of the billing cycle, which is from 21:00:00 (UTC+8) on February 1, 2021 to 22:00:00 (UTC+8) on February 1, 2021.

Enable or disable the bandwidth cap feature

  1. Log on to the Alibaba Cloud CDN console.
  2. In the left-side navigation pane, click Domain Names.
  3. On the Domain Names page, find the domain name that you want to manage and click Manage in the Actions column of the domain name.
  4. In the management pane of the domain name, click Traffic Throttling.
  5. Authorize CloudMonitor to access your CDN resources.
    1. Click Authorize next to Role Authorization.
    2. On the Cloud Resource Access Authorization page, click Confirm Authorization Policy.
  6. In the Bandwidth Cap section, click Modify.
  7. Enable or disable the bandwidth cap feature based on your business requirements.
    • Enable bandwidth cap: Turn on Bandwidth Cap and set a maximum bandwidth value.
      Note The conversion between each 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.
  8. Click OK.

Restore CDN services

Alibaba Cloud CDN does not automatically restore the suspended services even if the average bandwidth value drops below the specified bandwidth cap. To restore the suspended services, you must log on to the Alibaba Cloud CDN console and enable the domain name. Procedure:

Log on to the Alibaba Cloud CDN console and navigate to the Domain Names page. Then, select the domain name that you want to manage and click Enable in the Actions column to enable the domain name.