All Products
Search
Document Center

PolarDB:Configure the auto scaling feature of DAS

Last Updated:Oct 19, 2023

The diagnostics feature of PolarDB for MySQL clusters is integrated with some features of Database Autonomy Service (DAS), such as auto scaling. You can enable the auto scaling feature on the Autonomy Center tab in the PolarDB console. This topic describes how to enable the auto scaling feature.

Limits

  • The PolarDB for MySQL cluster must be of the Cluster Edition. Multi-master Cluster (Database/Table) Edition, Single Node Edition, and X-Engine Edition are not supported. For more information about cluster editions, see Editions.
  • No cluster specification change tasks are being performed for the PolarDB for MySQL cluster.
  • PolarDB for MySQL clusters that use the pay-as-you-go and subscription billing methods all support auto scaling.

Billing

For information about the billing rules, see Configuration change fees.

Precautions

  • The auto scaling feature of DAS does not support separate auto scaling of the primary node and read-only nodes. After an auto scale-back, all read-only nodes use the same specification as the primary node. Proceed with caution.
    Note If your PolarDB for MySQL cluster contains read-only nodes that use different specifications from the primary node, and Automatic Scale-up/out is enabled, when the average CPU utilization reaches the specified threshold within the observation window, PolarDB for MySQL selects one of the following scaling methods based on the real-time read/write traffic of the cluster:
    • Add read-only nodes that use the same specification as the primary node.
    • Add read-only nodes that use the same specification as an existing read-only node in the cluster.
      Note This method is applicable to the scenario where the average CPU utilization of read-only nodes reaches the specified threshold.
    • Upgrade read-only nodes to the same specification as the primary node.
    After auto scaling-in 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. The following scale-in methods may be used:
    • Delete the added read-only nodes.
      Note The specifications of the remaining read-only nodes stay unchanged.
    • Downgrade all read-only nodes to the same specification as the primary node.
  • 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 for MySQL 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 upper-left corner of the console, 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. In the left-side navigation pane, choose Diagnostics and Optimization > Quick Diagnostics.
  5. On the page that appears, click the Autonomy Center tab.
  6. In the upper-right corner of the Autonomy Center section, click Autonomy Service Settings.
    Autonomy Service Settings
  7. On the Autonomous Function Settings tab of the Autonomous Function Management panel, turn on the switch.
    Enable Autonomy
  8. On the Optimization and Throttling tab, select Automatic Scale-up/out and Automatic scale-down/in.
    • If you select Automatic Scale-up/out and the average CPU utilization is greater than or equal to the specified value within the observation window, the PolarDB for MySQL cluster is scaled up based on loads after the observation window ends. For example, the average CPU utilization threshold is 70%, the observation window is 5 minutes, and the time required to complete a scaling activity is 10 minutes. When the average CPU utilization of a node of the cluster exceeds 70%, an auto scaling is triggered. The system chooses a scaling method based on the read/write traffic. If the traffic surge is mainly caused by read traffic, read-only nodes are added. If the traffic surge is mainly caused by write traffic, of if the primary node is under excessive workloads, the cluster specifications are upgraded. If the primary node is overloaded, the cluster specifications are upgraded.
    • After you select Automatic Scale-down/in, 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. If read-only nodes are added, they will be gradually released. If cluster specifications are upgraded, the cluster will be scaled down. In PolarDB for MySQL, you can upgrade or downgrade only clusters. You cannot upgrade or downgrade a single node in a cluster.
  9. Specify the Automatic Scale-up/out and Automatic Scale-down/in parameters and click OK.
    ParameterDescription
    Average CPU Utilization ≥The threshold that is used to trigger automatic scale-out. If the average CPU utilization is greater than or equal to the specified value, an upgrade or scale-out activity is automatically triggered.
    Maximum SpecificationsThe maximum specifications to which DAS can upgrade the cluster. After an upgrade is triggered, the specifications of a PolarDB for MySQL cluster is upgraded tier by tier until the highest specifications are applied. For example, the cluster is upgraded from 4 cores to 8 cores, and then to 16 cores.
    Max number of Read-Only NodesThe 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 cluster endpoint. If the cluster uses a custom endpoint, you must specify whether to associate these nodes with the endpoint by specifying the Automatically Associate New Nodes parameter. For more information about how to configure Automatically Associate New Nodes, see Configure PolarProxy.
    Observation WindowIf the average CPU utilization reaches or exceeds the specified threshold during the observation period, PolarDB for MySQL automatically upgrades or scales out the cluster after the observation period expires. This ensures that the cluster can handle all read and write requests. 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.
    Quiescent PeriodThe minimum interval between two scaling activities. During a quiescent period, PolarDB for MySQL 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 value within the observation period, PolarDB for MySQL automatically triggers the auto scaling operation.