All Products
Search
Document Center

PolarDB:Auto scaling

Last Updated:Mar 14, 2024

You can use the auto scaling feature to scale up or down a cluster for which the serverless feature cannot be enabled, such as a PolarDB for MySQL 5.6 cluster. You can configure auto scaling parameters on the Basic Information page of a cluster in the PolarDB console. The cluster is automatically scaled up or down based on the specified configurations. This topic describes how to configure auto scaling parameters.

Background information

It takes at least 15 minutes for automatic configuration changes to take effect. We recommend that you do not use this configuration change method during short-term business surges. If you do not want the system to automatically scale your cluster back after a scale-out, you can choose not to enable Auto Scaling-in. PolarDB for MySQL provides the following configuration change methods: manual configuration change, temporary upgrade, automatic configuration change, and DAS-based scaling. You can select a method based on your business requirements.

  • Manual configuration change: If you want to permanently change the configuration of your PolarDB cluster, we recommend that you manually upgrade or downgrade the cluster. For more information, see Manually upgrade or downgrade a PolarDB cluster.

  • Temporary upgrade: This method is suitable for short-term business surges. For more information, see Perform a temporary cluster upgrade.

  • Automatic configuration change (auto scaling): The system can automatically scale your clusters based on your business workloads. This method is not suitable for short-term (less than 15 minutes) business surges.

  • DAS-based scaling: If your business frequently experiences drastic fluctuations, we recommend that you use the auto scaling feature provided by Database Autonomy Service (DAS). For more information, see Configure the auto scaling feature of DAS.

Prerequisites

  • The auto scaling feature can be enabled only for PolarDB for MySQL 5.6 clusters. Other versions of PolarDB for MySQL clusters can be automatically scaled up after the serverless feature is enabled for the clusters. For more information about the serverless feature, see Overview.

  • This feature is available for clusters of PolarDB for MySQL Cluster Edition. This feature is not supported by clusters of Multi-master Cluster (Database/Table) Edition. For more information about the preceding two editions, see Editions.

  • No cluster specification change tasks are being performed for the PolarDB cluster.

Billing

This feature is supported for PolarDB for MySQL clusters that use the pay-as-you-go and subscription billing methods.

Pay-as-you-go

Pay-as-you-go clusters are charged on an hourly basis. After you change the configuration of a pay-as-you-go cluster, the cluster is charged at the new price on an hourly basis.

Subscription

Change type

Description

Upgrade specifications or add nodes

Payment = Total fees of the new configuration for the remaining subscription period (Monthly price of the new configuration/30/24 × Remaining subscription period measured in hours) - Total fees of the original configuration for the remaining subscription period (Monthly price of the original configuration/30/24 × Remaining subscription period measured in hours)

Example: The monthly price of the new specifications is USD 14,400. The monthly price of the original specifications is USD 7,200. The remaining subscription duration is 50 days. The fee for the specification upgrade is calculated by using the following formula: (14,400/30/24 × 50 × 24) - (7,200/30/24 × 50 × 24) = USD 12,000.

Downgrade specifications or delete nodes

Refund = Total fees of the original configuration for the remaining subscription period (Monthly price of the original configuration/30/24 × Remaining subscription period measured in hours) - Total fees of the new configuration for the remaining subscription period (Monthly price of the new configuration/30/24 × Remaining subscription period measured in hours).

For example, to purchase a subscription cluster for three months, you are charged USD 3,500. You pay USD 3,000 for the cluster after you use coupons. After two months, the total fees of the original configuration for the remaining subscription period become USD 1,000. The total fees of the new configuration for a month are USD 800. The refund is calculated by using the following formula: USD 1,000 - USD 800 = USD 200.

Note

You can receive a refund for a downgraded configuration of a subscription cluster. However, fees for the entire cluster cannot be refunded. If you want to apply for a refund for the entire cluster, submit a ticket. If your application is approved, your subscription cluster is frozen and will be deleted after 14 days.

The billing rules for manual scaling and automatic scaling are the same. For more information, see Configuration change fees.

Refunds for cluster downgrade

When the specifications of a subscription cluster exceed your business requirements and your account has the configuration downgrade privilege, you can downgrade the configurations of the cluster in real time. For more information about the refund policy, see Rules for unsubscribing from resources.

Limits

  • You can upgrade or downgrade only clusters. You cannot upgrade or downgrade a single node in a cluster.

  • When you upgrade or downgrade a cluster, data stored in the cluster is not affected.

  • During the upgrade or downgrade process, your applications are temporarily disconnected from the cluster for no more than 30 seconds. We recommend that you upgrade or downgrade your cluster during off-peak hours and make sure that your applications are configured with the automatic reconnection mechanism.

  • A cluster upgrade or downgrade has minor impacts on the primary node of a PolarDB cluster. However, the upgrade or downgrade degrades the performance of read-only nodes in the cluster. As a result, the read-only nodes require more time to handle requests during the upgrade or downgrade process.

Procedure

  1. Log on to the PolarDB console.

  2. In the top navigation bar, select the region in which the cluster that you want to manage is deployed.

  3. On the Clusters page, click the ID of the cluster.

  4. On the Basic Information page, click Settings in the upper-right corner of the Database Nodes section.

    设置

  5. In the dialog box that appears, configure the following parameters.

    Parameter

    Description

    Auto Scaling-out

    Specifies whether to enable the auto scaling feature.

    Observation Period

    If the CPU utilization reaches the specified threshold during the observation period, PolarDB automatically adds nodes or upgrades the specifications of your cluster when the observation period ends. The system determines the scaling method based on the inbound read and write requests. The minimum observation period is 5 minutes, and a scaling activity needs 10 minutes to be completed. Therefore, it takes at least 15 minutes for the auto scaling to take effect. For example, if the observation period is 5 minutes and the time required to complete a scaling activity is 10 minutes, you must wait 15 minutes before you can check the scaling result.

    Note

    The scale-in observation window is equal to the observation window plus 10 minutes. For example, if the observation window is set to 30 minutes, the scale-in observation window is 40 minutes.

    CPU Usage

    The threshold that is used to trigger automatic scale-out. If the CPU Usage is greater than or equal to the specified threshold, automatic scale-up is triggered.

    Maximum Specification

    The maximum specifications to which the system can upgrade the cluster. After an automatic scale-up is triggered, the system scales up your PolarDB cluster to the maximum specifications in small increments. For example, the CPU specification can be upgraded from 4 cores to 8 cores, and then to 16 cores until the upper limit is reached.

    Maximum Number of Read-only Nodes

    The maximum number of read-only nodes that can be automatically added to the cluster. After an auto scaling is triggered, the system adds one or two read-only nodes each time until the specified upper limit is reached.

    Note
    • The nodes that are automatically added are associated with the default endpoint of your cluster. If you use a custom endpoint, you must specify whether these nodes are automatically associated with the endpoint by using the Automatically Associate New Nodes parameter. For more information about how to configure the Automatically Associate New Nodes parameter, see Configure PolarProxy.

    • If you want the system to perform only scale-up and no scale-out, set this parameter to the current number of read-only nodes of the cluster.

    • During a scale-up, transient connections occur to all nodes of the cluster. This does not occur during a scale-out.

    Auto Scaling-in

    Specifies whether to enable automatic scale-back.

    Note

    After automatic scale-back is enabled, if the cluster is not in the quiescent period and the average CPU utilization of automatically scaled nodes remains at less than 30% for more than 99% of the scale-in observation window (the observation window plus 10 minutes), the cluster is scaled back tier-by-tier to the original specifications.

    Quiescent Period

    The minimum interval between two scaling activities. During a quiescent period, PolarDB monitors the resource usage of a cluster but does not trigger scaling activities. If a quiescent period and an observation period end at the same time and the CPU utilization reaches the threshold within the observation period, PolarDB automatically triggers the auto scaling operation.

  6. Click OK.

You can disable auto scaling at any time. If the cluster has been automatically scaled up/out but has not been scaled back when you disable auto scaling, the cluster will not be scaled back to its original configurations.