Database Autonomy Service (DAS) provides automatic scaling for local resources. When the average CPU utilization of a database instance over an observation window reaches the specified threshold, DAS utilizes available resources on the local host to increase the number of CPU cores of the database instance to the specified value.

Prerequisites

  • A standard PolarDB for MySQL cluster of the Cluster Edition is connected to DAS.
  • A DAS-linked role is created. For more information, see AliyunServiceRoleForDAS role.

Benefits

Automatic scaling for local resources is implemented by removing the limits imposed by cgroups on local hosts. Compared with automatic scale-up, automatic scaling for local resources provides the following benefits.

Item Automatic scaling for local resources Automatic scale-up
Scalable resources You can scale up CPUs and IOPS, but cannot scale up memory and connections. You can scale up CPUs, IOPS, memory, and connections at the same time.
Scaling speed Quick scaling:
  • The minimum length of a scale-up observation window is 30 seconds.
  • After a scale-up is triggered, the scale-up task can be completed within seconds.
Slow scaling:
  • The minimum length of a scale-up observation window is 5 minutes.
  • Scaling takes a longer period of time because specification scale-up is involved.
Upgrade process No transient connections occur during the upgrade process because specification changes are not required. Transient connections occur because specification changes are required.

Precautions

  • This feature is in its trial period and is available free of charge. You will be charged for using this feature in the future.
  • After automatic scaling for local resources is enabled for a database instance, we recommend that you disable automatic scale-up for the database instance because the two features conflict with each other. For example, assume that both features are enabled. When automatic scale-up is triggered after automatic scaling for local resources, automatic scaling for local resources becomes invalid.
    Note You can disable automatic scale-up by performing the following operations: On the details page of a database instance, click Autonomy Service Settings in the upper-right corner. On the Autonomous Function Settings tab of the Autonomous Function Management panel, clear Automatic Scale-up/out.
  • If the host where a database instance resides does not have sufficient CPU resources, the instance is not scaled up.

Procedure

  1. Log on to the DAS console.
  2. Create an automatic scaling policy for local resources.
    • Create an automatic scaling policy for local resources on the Management and Settings page.
      1. In the left-side navigation pane, click Management and Settings.
      2. In the Auto Scaling Policies section, click Add Policy. In the Add Policy panel, configure the following parameters.
        Table 1. Configure 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 MySQL is supported.
        Specifications The specifications of the selected database engine. Only General-purpose Cluster is supported.
        Average CPU Utilization The threshold based on which automatic scale-up is triggered. If the average CPU utilization is greater than or equal to the specified value, automatic scale-up is triggered.
        Scale-up Observation Window The time range during which you want to observe the scale-up performance of the instance. DAS checks the CPU utilization of the instance during the scale-up observation window at specific intervals. When the CPU utilization reaches the value of the Average CPU Utilization parameter, automatic scale-up is triggered.
        CPU Scale-up Step Size The number of cores to add during each CPU scale-up. The value must be an integer ranging from 1 to 31.

        For example, if the number of CPU cores of an instance is 4 and the value of CPU Scale-up Step Size is 2, the number of CPU cores is increased to 6 after a CPU scale-up. If the average CPU utilization still 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 single database instance is 32, which is calculated based on the following formula: 4 × Original number of CPU cores. For example, if the original number of CPU cores of an instance is 4, the CPU of the instance can be scaled up to a maximum of 16 cores.
        Scale-down Observation Window The time range during which you want to observe the scale-down performance of the instance. DAS checks the CPU utilization of the instance during the scale-down observation window at specific intervals. When the CPU utilization is less than 30% for 99% of the time, automatic scale-down is triggered.

        The number of CPU cores is decremented by the value of CPU Scale-up Step Size during each scale-down until the instance is scaled back to its original CPU specifications.

      3. In the Auto Scaling Policies section, click Apply in the Actions column corresponding to the created policy.
      4. In the Apply Policies dialog box, select the database instances to which you want to apply the policy, and click xy.
      5. Click Confirm to apply the policy to the selected database instances.
    • Create an automatic scaling policy for local resources on the Autonomous Function Settings tab of the Autonomous Function Management panel.
      1. In the left-side navigation pane, click Instance Monitoring.
      2. On the page that appears, find the database instance for which you want to create an automatic scaling policy for local resources and click the instance ID. The instance details page appears.
      3. Click Autonomy Service Settings in the upper-right corner.
      4. On the Autonomous Function Settings tab of the Autonomous Function Management panel, click the Auto Scaling tab. In the Recommended Policy section, click Apply in the Actions column corresponding to a policy to apply the policy to the instance.
        Note
        • To create an automatic scaling policy for local resources, click Add Policy. For more information about how to configure the relevant parameters, see Table 1.
        • To modify a created policy, click Modify in the Actions column corresponding to the policy. In the Update Policy panel, update the policy settings.
        • To cancel the application of a policy to the instance, click Cancel in the Actions column corresponding to the policy in the Applied Policy section.

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 automatic scaling for local resources is enabled and click the instance ID. The instance details page appears.
  3. In the left-side navigation pane, click Autonomy Center.
  4. On the Autonomy Center page, select a time range and filter the auto scaling events that occurred in the selected time range.
  5. Click Details in the Auto-Scaling Events section to view the details of auto scaling.
    p2022021701