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 is of the Cluster Edition. Single Node, Archive Database (High Compression Ratio), and Archive Database Cluster Edition are not supported. For more information about cluster editions, see Editions.
  • No upgrade or downgrade task is being performed for the PolarDB 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 scale-out or scale-up of the primary node and read-only nodes. After an auto scale-in or scale-down task is performed, all read-only nodes use the same specification as the primary node. Proceed with caution.
    Note In the following case: A PolarDB cluster contains more than two nodes, read-only nodes use different specifications from the primary node, the primary node and read-only node specifications are inconsistent, Automatic Scale-up/out is enabled, and the average CPU utilization is greater than or equal to the specified value within the entire observation window. PolarDB can select one of the following scale-out or scale-up methods depending on the real-time read/write traffic of the cluster:
    • Add a read-only node that uses the same specification as the primary node.
    • Add a read-only node that uses 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 is greater than or equal to the specified value.
    • Upgraded read-only nodes to the same specification as the primary node.
    If the CPU utilization remains at less than 30% for more than 99% of the silent period after you enable Automatic Scale-down/in, auto scale-in or scale-down tasks are triggered step by step for the PolarDB cluster when the silent period ends. The following scale-in or scale-down methods may be used:
    • Delete a read-only node that you have added.
      Note The specifications of remaining read-only nodes stay unchanged.
    • Downgrade all read-only nodes to the same specifications 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 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 where 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 > Diagnosis.
  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 Autonomy Service Settings tab of the Settings dialog box, turn on Enable Autonomy Service and then turn on Automatic Scale-up/out and Automatic Scale-down/in.
    Note
    • After you turn on Automatic Scale-up/out, if the average CPU utilization reaches or exceeds the specified threshold during the observation period, PolarDB 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.
    • If the CPU utilization remains at less than 30% for more than 99% of the silent period after you enable Automatic Scale-down/in, auto scale-in or scale-down tasks are triggered step by step for the PolarDB cluster when the silent period ends. The auto scale-in process ends when the cluster uses its initial specifications.
    Enable Autonomy
  8. Specify the Automatic Scale-up/out and Automatic Scale-down/in parameters and click OK.
    Parameter Description
    Average CPU Utilization The threshold that is used to trigger automatic scale-up. When the average CPU utilization reaches or exceeds the specified threshold, an upgrade or scale-out activity is automatically triggered.
    Maximum Specifications The highest specifications to which a cluster can be upgraded. After an upgrade is triggered, the specifications of a PolarDB 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 Nodes The maximum number of read-only nodes that can be automatically added to the cluster. After a scale-out activity is triggered, read-only nodes are automatically added to a PolarDB cluster one after another 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 Window If the average CPU utilization reaches or exceeds the specified threshold during the observation period, PolarDB 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.
    Quiescent Period The minimum interval between two automatic scale-up operations or two automatic scale-down operations. During a silent period, PolarDB monitors the resource usage of a cluster but does not trigger scaling activities. If a silent period and an observation period expire at the same time and the average CPU utilization within the observation period reaches the threshold, PolarDB automatically triggers an upgrade.