All Products
Search
Document Center

PolarDB:Auto-scaling of local resources of a PolarDB for MySQL cluster

Last Updated:Sep 20, 2024

PolarDB for MySQL supports the auto-scaling of local resources feature of Database Autonomy Service (DAS). When the average CPU utilization of a cluster within a monitoring window reaches the specified threshold, DAS automatically scales up the number of CPU cores of the cluster by a predefined increment based on the original specifications.

Prerequisites

  • Your PolarDB for MySQL cluster runs Cluster Edition and uses general-purpose specifications.

    Note

    PolarDB for MySQL 8.0.2 does not support auto-scaling of local resources.

  • The AliyunServiceRoleForDAS role is created. For more information, see AliyunServiceRoleForDAS role.

Usage notes

  • This feature is free of charge.

  • The auto-scaling of local resources feature of DAS is mutually exclusive with the auto-scaling of specifications feature of PolarDB clusters. After you enable the auto-scaling of local resources feature, we recommend that you disable the auto-scaling of specifications feature. If you enable the auto-scaling of specifications feature after you enable the auto-scaling of local resources feature, the auto-scaling of local resources feature does not take effect.

Comparison between the auto-scaling of local resources feature of DAS and the auto-scaling of specifications feature of PolarDB clusters

The following table describes the differences between the auto-scaling of local resources feature of DAS and the auto-scaling of specifications feature of PolarDB clusters.

Item

Auto-scaling of local resources

Auto-scaling of cluster specifications

Scalable resources

You can scale only CPU cores and IOPS. You cannot scale memory and connections.

You can scale CPU cores, IOPS, memory, and connections at the same time.

Scaling speed

Fast

  • The minimum duration of a scale-up observation window is 30 seconds.

  • A scale-up task can be completed within seconds after the task is triggered.

Slow

  • The minimum duration of a scale-up observation window is 5 minutes.

  • Scaling requires a longer period of time because the specifications of the cluster are changed.

Scaling process

No network interruptions occur during the scaling process because specification changes are not required.

Network interruptions occur because specification changes are required.

Compared with auto-scaling of cluster specifications, auto-scaling of local resources has the following advantages:

  • A scale-up task can be completed within several seconds.

  • No network interruptions occur during the scaling process.

Procedure

  1. Log on to the DAS console.

  2. In the left-side navigation pane, click Management and Settings.

  3. In the upper-right corner of the Auto Scaling Policies section, click Add Policy.

  4. In the Add Policy panel, configure the parameters. The following table describes the parameters.

    Parameter

    Description

    Policy Name

    The name of the policy.

    Mode

    The mode of the policy. Select Automatic Scaling for Local Resources.

    Engine Type

    The type of the database engine. Only PolarDB for MySQL is supported.

    Specifications

    The specifications of the selected database engine. Only general-purpose specifications are supported.

    Average CPU Utilization

    The threshold for CPU utilization. When the average CPU utilization exceeds the threshold, auto-scaling of CPU cores is triggered.

    Scale-up Observation Window

    The CPU utilization observation window for a scale-up. The system monitors the CPU utilization of the cluster during the observation window. When the CPU utilization reaches the value specified by the Average CPU Utilization parameter, a scale-up task is triggered.

    CPU Scale-up Step Size

    The number of cores that you want to add during each CPU scale-up. The value must be an integer between 2 and 31.

    For example, if the number of CPU cores of a cluster is 4 and the CPU Scale-up Step Size value is 2, the number of CPU cores is increased to 6 after a CPU scale-up. If the average CPU utilization meets the conditions for triggering automatic scale-up after a scale-up is complete, another scale-up is performed until the maximum number of CPU cores is reached.

    Note

    The maximum number of CPU cores for a cluster is calculated based on the following formula: 4 × Original number of CPU cores. The maximum number cannot exceed 32.

    For example, if the original number of CPU cores of a cluster is 4, the CPU cores of the cluster can be scaled up to 16.

    Scale-down Observation Window

    The CPU utilization observation window for a scale-down. The system monitors the CPU utilization of the cluster during the observation window. When the CPU utilization is below 30% for more than 99% of the observation window, a scale-down task is triggered.

    The number of CPU cores is decremented by the CPU Scale-up Step Size value during each scale-down until the number of CPU cores return to the original value.

  5. Click Next Step.

  6. On the Apply Policies page, select the PolarDB for MySQL clusters to which you want to apply the policy and click xy.

    应用

  7. Click Confirm. Then, the policy is applied to the selected clusters.

View the results of automatic scaling for local resources

  1. In the left-side navigation pane of the DAS console, click Instance Monitoring.

  2. On the page that appears, find the database instance for which you want to view the results of automatic scaling for local resources and click its ID. The instance details page appears.

  3. In the left-side pane of the instance details page, click Autonomy Center.

  4. On the Autonomy Center tab, specify a time range and view the auto-scaling events that occurred within the specified time range.

  5. Click Details in the Auto-Scaling Events section to view the details of auto scaling events.

    p2022021701