The Quick Diagnostics feature for PolarDB for MySQL clusters integrates some capabilities of Database Autonomy Service (DAS). You can enable the auto scaling service in the Autonomy Center. This topic describes how to configure auto scaling.
Prerequisites
-
Your PolarDB for MySQL cluster must meet the following requirements:
-
Product Edition: Enterprise Edition
-
Series: Cluster Edition
-
-
No configuration changes are in progress on the cluster.
-
A service-linked role for DAS must be created.
Billing
For more information, see Configuration change fees.
Usage notes
-
The auto scaling feature of DAS does not support scaling up the primary node and read-only nodes independently. After a scale-down, all read-only nodes are changed to match the specifications of the primary node. Use this feature with caution.
NoteIf a PolarDB cluster has more than two nodes, the primary node and read-only nodes have different specifications, and you enable Auto Scaling, the following logic applies: If the average CPU utilization is greater than or equal to the specified threshold during the observation window, PolarDB selects one of the following scale-up methods based on the real-time read and write traffic of the cluster:
-
Add read-only nodes with the same specifications as the primary node.
-
Add read-only nodes with the same specifications as an existing read-only node in the cluster.
NoteThis method applies when the average CPU utilization of a read-only node is greater than or equal to the specified threshold.
-
Upgrade the cluster to make all nodes have the same specifications as the primary node.
After you enable Auto Scaling-in, if the cluster is not in a Quiescent Period and its CPU utilization remains below 30% for more than 99% of the scale-down observation window, the system automatically scales down the cluster tier by tier to its original specifications. The system may use one of the following scale-down methods:
-
Delete the added read-only nodes.
NoteThe specifications of the remaining read-only nodes are not changed.
-
All read-only nodes are changed to have the same specifications as the primary node.
-
-
Upgrading or downgrading cluster specifications does not affect the data in your cluster.
-
During a specification change, you may experience a transient disconnection that lasts for about 30 seconds. We recommend that you perform this operation during off-peak hours and ensure that your application has an automatic reconnection mechanism.
-
During a configuration change for a PolarDB cluster, read-only nodes may experience a higher replication lag than usual.
Procedure
-
Log on to the PolarDB console. In the left-side navigation pane, click Clusters. Select the region where your cluster is deployed, and then click the cluster ID.
-
In the left-side navigation pane, choose .
-
Click the Autonomy Center tab. In the Autonomy Center section, click Autonomy Service Settings.
-
In the Autonomous Function Management dialog box, on the Autonomous Function Settings tab, turn on the autonomy service switch.
-
On the Optimization and Throttling tab, select Auto Scaling and Auto Scaling-in.
-
After you select Auto Scaling, if the average CPU utilization is greater than or equal to the specified value during the entire Observation Window, PolarDB will scale up the cluster based on the cluster load after the Observation Window ends. For example, if the threshold for average CPU utilization is 70%, the observation window is 5 minutes, and the automatic scale-up time is 10 minutes, the cluster is scaled up when the average CPU utilization of a node in the cluster exceeds 70% during the observation window. When scaling up the cluster, the system selects whether to add nodes or upgrade specifications based on the real-time read and write traffic. By default, the system adds read-only nodes when read traffic is dominant, and upgrades the cluster specifications when write traffic is dominant. In special scenarios, such as when the load on the primary node is excessively high, the system will upgrade the cluster specifications.
-
After you select Auto Scaling-in, if the cluster is not in a Quiescent Period and the average CPU utilization of the scaled-up nodes remains below 30% for more than 99% of the scale-down observation window, the system automatically scales down the cluster tier by tier to its original specifications. If read-only nodes were added during scale-up, the system removes them one by one during scale-down. If cluster specifications were upgraded during scale-up, the system downgrades them during scale-down. For a PolarDB for MySQL cluster, you can upgrade or downgrade specifications only for the entire cluster, not for individual nodes.
-
-
Configure the Auto Scaling and Auto Scaling-in parameters, and then click OK.
Parameter
Description
CPU Utilization ≥
The threshold that triggers automatic scale-up. When the average CPU utilization is greater than or equal to this value, automatic scale-up is triggered.
Maximum Specifications
The upper limit for automatic scale-up. After a scale-up is triggered, the system upgrades the PolarDB cluster specifications tier by tier, for example, from 4 cores to 8 cores and then to 16 cores, until this limit is reached.
Maximum Number of Read-only Nodes
The maximum number of read-only nodes that can be automatically added. After a scale-up is triggered, the system adds one or two read-only nodes at a time as needed until this limit is reached.
NoteAutomatically scaled-out nodes are added to the default cluster endpoint. For custom endpoints, you must configure Automatically Associate New Nodes. For more information about how to configure Automatically Associate New Nodes, see Configure PolarProxy.
Observation Window
If the average CPU utilization meets or exceeds the specified threshold throughout this period, PolarDB selects a scale-up method (adding nodes or upgrading specifications) based on real-time traffic after the window ends. For example, if the observation window is 5 minutes and the scaling operation takes 10 minutes, you will see the results of the auto scaling after about 15 minutes.
NoteThe scale-down observation window is the Observation Window duration plus 10 minutes. For example, if you set the Observation Period to 30 minutes, the scale-down observation window is 40 minutes.
Quiescent Period
The minimum interval between two consecutive automatic scale-up or scale-down operations. During the quiescent period, PolarDB continues to monitor metrics but does not trigger scaling. If the quiescent period and the observation window end at the same time, and the CPU utilization reaches the threshold within that observation window, PolarDB triggers an auto scaling event.