All Products
Search
Document Center

Tair (Redis® OSS-Compatible):Enable bandwidth auto scaling

Last Updated:Oct 24, 2024

When your business is facing an unexpected or anticipated surge in traffic, you can use the bandwidth auto scaling feature provided by Tair(Redis OSS-compatible). This feature continuously monitors the average bandwidth usage of an instance in real time and automatically scales the instance bandwidth based on the bandwidth usage. It enables you to easily handle various traffic spikes, allowing you to focus on business improvement.

Prerequisites

The instance is an ApsaraDB for Redis Community Edition instance or a Tair DRAM-based or persistent memory-optimized instance.

Common scenarios

The bandwidth of an instance varies based on the instance type. If the bandwidth in use reaches the allocated bandwidth, network congestion may occur and instance performance may deteriorate. To prevent these situations, you can enable the bandwidth auto scaling feature. A bandwidth adjustment helps you increase bandwidth at a lower cost than an instance specification change and can help prevent transient connections.

Note

If the instance is a Community Edition instance that requires a sharp bandwidth increase, we recommend that you change the instance into an Enhanced Edition (Tair) instance. The maximum bandwidth supported by a Tair instance is more than 96 Mbit/s.

Scenario

Description

Handle traffic spikes

You can adjust the bandwidth of the instance to handle traffic spikes during promotional events such as a flash sale. After these events end, you can decrease the bandwidth of the instance to reduce costs.

Mitigate impacts on your business

If a large number of read and write operations are performed on large keys within a short period of time, you must temporarily increase the bandwidth of the instance to mitigate impacts on your business and reserve time to process these operations.

Deal with skewed requests at low costs

If your instance uses the cluster or read/write splitting architecture, specific data shards or read replicas of the instance are more frequently accessed than others. As a result, the bandwidth consumption of these data shards or read replicas frequently reaches the allocated bandwidths. However, the usage of the bandwidths that are allocated to other data shards or read replicas is low.

After you enable the bandwidth auto scaling feature, the system identifies the data shards or read replicas whose allocated bandwidths are insufficient and increases the bandwidths for them. You do not need to manually increase the bandwidth or change the configurations of the instance to which these data shards or read replicas belong. This reduces costs and facilitates O&M.

Bandwidth scaling process

After you enable the bandwidth auto scaling feature, the system performs the following operations based on the auto scaling policy and observation window that you configure. The increment or decrement is calculated by the system.

  • If the bandwidth increase threshold of an instance is reached, the system increases the bandwidth and continues to monitor bandwidth usage. If the threshold is reached again, the system increases the bandwidth again. The bandwidth can be increased up to three times the default bandwidth of the instance type. If you want to increase this bandwidth limit, you can upgrade the specifications of your instance and then adjust the bandwidth.

  • If the bandwidth decrease threshold of an instance is reached, the system decreases the bandwidth and continues to monitor bandwidth usage. If the threshold is reached again, the system decreases the bandwidth again. The bandwidth can be decreased to the default bandwidth of the instance type.

Note
  • If your instance uses the cluster or classic read/write splitting architecture, bandwidth monitoring and elastic scaling occur at the level of data shards or read replicas. Each node operates independently from the others.

  • If your instance uses the cloud-native read/write splitting architecture, updates uniformly take effect across all nodes. The system primarily relies on the node that has the highest bandwidth for read and write operations.

  • If you enable the subscription service, you are notified of every increase or decrease by the notification method that you select, such as email. For more information about how to enable the subscription service, see the "Procedure" section in this topic.

  • To ensure that Database Autonomy Service (DAS) can access resources of your instance, the system authorizes DAS to assume the AliyunServiceRoleForDAS role after you enable this feature.

Limits

  • After the bandwidth of an instance is automatically upgraded, a cooldown period of at least 1 hour is required before automatic bandwidth scale-back can be triggered.

  • If an instance has unexpired bandwidth plans, you cannot enable bandwidth auto scaling for the instance. In this case, you must unsubscribe from the bandwidth plans. For more information, see Refund management.

  • The bandwidth of an instance or a shard can be increased by up to six times the default bandwidth of the instance, but the increase in bandwidth cannot exceed 192 Mbit/s. For example, if the default bandwidth of a Tair DRAM-based master-replica instance equipped with 2 GB of memory is 96 Mbit/s, you can increase the bandwidth of the instance by 192 Mbit/s. As a result, the maximum bandwidth of the instance is 288 Mbit/s.

    To further increase the bandwidth of the instance, you can change the instance configurations or instance architecture. For example, you can change the standard architecture to the cluster architecture. For more information, see Overview.

  • We recommend that you do not manually adjust the instance bandwidth and enable bandwidth auto scaling for the instance at the same time.

    If these operations are performed at the same time, bandwidth auto scaling takes precedence. When the bandwidth is scaled back, the instance is scaled back to the default bandwidth of the instance type.

  • If you perform one of the following operations, bandwidth auto scaling is disabled for your instance. You must re-enable this feature for the instance based on your needs.

    Operation

    Exception

    Upgrade the major version

    N/A

    Change the configurations of an instance

    If the instance uses the standard architecture, the bandwidth settings remain valid after you change the configurations of the instance.

    Migrate an instance across zones

    If the instance uses the standard architecture, the bandwidth settings remain valid after you migrate the instance across zones.

Billing

You are charged per hour based on the amount and usage duration of the extra bandwidth that you purchase. The fees vary based on the region that you select. For more information, see Billable items.

Note

You are not charged for the default bandwidth that is provided for the instance type. You are charged only for the extra bandwidth that you purchase.

Procedure

  1. Log on to the ApsaraDB for Redis console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click the instance ID.

  2. In the Configuration Information section, click Modify to the right of Maximum Internal Bandwidth.

    Note

    The first time you log on to the DAS console, follow the instructions to grant permissions to your account.

  3. Turn on Bandwidth Auto Scaling.

  4. In the DAS console, configure the policy for bandwidth auto scaling and event subscription.

    1. Set the parameters that are described in the following table to configure the policy for bandwidth auto scaling.

      Section/Tab

      Parameter

      Description

      Automatic Bandwidth Upgrade

      Automatic Bandwidth Upgrade

      Select the check box to enable the feature.

      Average Bandwidth Usage ≥

      Select the threshold of average bandwidth usage for triggering an automatic scale-up. Valid values: 50% to 95%.

      Note
      • The system compares the bandwidth usage of inbound traffic and that of outbound traffic, and takes the larger value as the average bandwidth usage.

      • The bandwidth of an instance can be increased to up to three times the default bandwidth of the instance type. You can also view the message about this limit in the panel.

      Observation Window

      Select the length of the observation window. Unit: minutes.

      Automatic Bandwidth Downgrade

      Automatic Bandwidth Downgrade

      Select the check box to enable the feature. Before you enable the feature, make sure that the Automatic Bandwidth Upgrade feature is enabled.

      Average Bandwidth Usage ≤

      Select the threshold of average bandwidth usage for triggering an automatic scale-down. Valid values: 10% to 70%. The threshold must be at least 10% lower than the scale-up threshold.

      Note
      • The system compares the bandwidth usage between inbound traffic and outbound traffic, and uses the larger value as the average bandwidth usage.

      The expected bandwidth after each scale-up or scale-down is calculated by using the following formula: Actual used bandwidth (Mbit/s)/((Scale-up threshold + Scale-down threshold)/2). After each scale-up operation, the system attempts to keep the actual bandwidth usage between the scale-up threshold and the scale-down threshold.

      For example, the default bandwidth of an instance is 96 Mbit/s, the scale-up threshold is set to 70%, the scale-down threshold is set to 30%, and the observation window is set to 15 minutes. If the average bandwidth usage is greater than or equal to 70% within the 15-minute observation window, the system scales up the bandwidth of the instance. The expected bandwidth after the scale-up is 135 MB/s. The value is obtained by using the following formula: ((96 × 0.7))/((0.7 + 0.3)/2)). If the average bandwidth usage is less than or equal to 30% of the bandwidth after the scale-out, the system scales down the bandwidth of the instance. The bandwidth can be scaled down to the default bandwidth of the current instance type.

  5. Click OK.

  6. (Optional) Click the Event Subscription Settings tab. Then, complete the event subscription settings to send notifications when the bandwidth of the instance is automatically upgraded or downgraded.

    If the bandwidth of the instance is automatically upgraded or downgraded, DAS generates an event at the Notice level. To use this feature, you must turn on the switch to enable event subscription and configure event notification parameters. For more information, see Event subscription.

Results

In the ApsaraDB for Redis console, Bandwidth Auto Scaling is turned on.