Database Autonomy Service (DAS) provides the automatic performance scaling feature for CPU specifications of database instances. DAS can automatically scale up your database instance to handle traffic spikes during peak hours and ensure the stability of your business. DAS monitors the CPU utilization of your database instance in real time. If the CPU utilization decreases within a specified observation window, DAS automatically scales down the database instance. This topic describes how to enable the automatic performance scaling feature.

Prerequisites

  • An ApsaraDB RDS for MySQL High-availability Edition instance that uses standard or enhanced SSDs or a PolarDB for MySQL cluster of the Cluster Edition is connected to DAS.
    Note The automatic performance scaling feature is not supported for ApsaraDB RDS for MySQL instances whose instance types are phased out. If the instance type of your ApsaraDB RDS for MySQL instance is phased out, you must change the instance type of the instance before you can enable the automatic performance scaling feature. For information about how to change the instance type of an ApsaraDB RDS for MySQL instance, see Change the specifications of an ApsaraDB RDS for MySQL instance.
  • The autonomy service is enabled for the database instance. For more information, see Autonomy center.
  • Your Alibaba Cloud account has sufficient balance to pay for scaled-up resources.
  • A DAS-linked role is created. For more information, see AliyunServiceRoleForDAS role.
    Note If you have not created a RAM role that is linked to DAS, DAS can automatically create a service-linked role when you enable the automatic performance scaling feature.

Process of automatic scale-up

Flowchart
After you enable automatic scale-up for your database instance, DAS scales up the database instance based on the loads on the instance if the average CPU utilization of the instance over the specified observation window reaches the specified threshold. The specifications of your database instance after a scale-up cannot exceed the specified maximum specifications. After the database instance is scaled up, DAS monitors the CPU utilization of the instance. If the CPU utilization exceeds the specified threshold again, DAS scales up the database instance again. This process is repeated until the CPU specification of the database instance is scaled up to the maximum specification that you specified.
Note
  • For an ApsaraDB RDS for MySQL instance, DAS does not automatically scale down the instance after the CPU utilization decreases to the specified threshold. You can enable the event subscription service to subscribe to notifications of scale-down suggestions. If the CPU utilization of your database instance is lower than 30% for longer than 99% of the observation window, DAS sends messages to suggest you to scale down the database instance. By default, an observation window is set to 30 minutes. You must manually scale down the database instance. For more information, see Change the specifications of an ApsaraDB RDS for MySQL instance.
  • For a PolarDB for MySQL cluster, if the CPU utilization is lower than 30% for longer than 99% of the quiescent period after you select Automatic Scale-down/in, a scale-down is triggered when the quiescent period ends. The PolarDB cluster is scaled down to the original specifications in small decrements.

Pricing

  • For an ApsaraDB RDS for MySQL instance:

    You are charged based on the new instance specifications after the automatic scale-up. The price for a scale-up varies based on the instance configurations, such as the region and the new instance specifications. For more information, visit the ApsaraDB RDS buy page.

  • For a PolarDB for MySQL cluster:

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

Scenarios

After you enable the automatic performance scaling feature for a database instance, DAS automatically scales up the database instance during peak hours. This can double the read/write throughput and lower the CPU utilization from higher than 90% to 25%. The database instance can run under a heavy load for approximately 10 hours. After the traffic decreases and the CPU utilization drops to lower than 25%, DAS sends messages to suggest you to scale down the database instance to the original specifications.

This way, DAS can manage your database instance to handle traffic spikes during peak hours and help ensure the stability of your business.

Impacts

  • When your database instance is being scaled up or scaled down, a transient connection that lasts approximately 30 seconds may occur. Make sure that your application is configured to automatically reconnect to the database instance.
  • If the database engine of the database instance is not of the latest version, DAS updates the database instance to run the database engine of the latest version when DAS scales up the database instance. This ensures the performance and stability of your database instance.

Procedure

  1. Log on to the DAS console.
  2. In the left-side navigation pane, click Instance Monitoring.
  3. On the page that appears, find the database instance that you want to manage and click the instance ID. The instance details page appears.
  4. In the left-side navigation pane, click Autonomy Center.
  5. In the upper-right corner of the Autonomy Center page, click Autonomy Service Settings.
    Autonomy Service Settings
  6. On the Autonomous Function Settings tab of the Autonomous Function Management panel, enable the autonomy service. Then, configure the following parameters on the Optimization and Throttling tab.
    • For an ApsaraDB RDS for MySQL instance, select Automatic Performance Scaling and configure the following parameters.
      Parameter Description
      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 threshold, automatic scale-up is triggered.
      Observation Window The time range during which you want to observe the performance of the database instance. DAS checks the CPU utilization of the database instance during an observation window at specific intervals. If the CPU utilization reaches the value of the Average CPU Utilization parameter, automatic scale-up is triggered.
      Maximum Specifications The maximum specifications to which you can upgrade the database instance. If the CPU utilization of the database instance reaches the value of Average CPU Utilization, DAS scales up the instance. If the CPU utilization of the database instance reaches the value of Average CPU Utilization again during the next observation window, DAS scales up the database instance again. This process is repeated until the database instance is scaled up to the maximum specifications that you specified.
    • For a PolarDB for MySQL cluster, select Automatic Scale-up/out and Automatic Scale-down/in and configure the following parameters.
      Parameter Description
      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 threshold, automatic scale-up is triggered.
      Maximum Specifications The maximum specifications to which you can upgrade the database instance. After automatic scale-up is triggered, the system scales up your PolarDB cluster to the maximum specifications in small increments. For example, the CPU specification can be upgraded from 4 cores to 8 cores, and then to 16 cores until the upper limit is reached.
      Maximum Number of Read-only Nodes The maximum number of read-only nodes that the cluster can contain. After automatic scale-up is triggered, read-only nodes are automatically added to the PolarDB cluster one by one until the upper limit is reached.
      Note The nodes that are automatically added are associated with the default endpoint of your cluster. If you use a custom endpoint, you must specify whether these nodes are automatically associated with the endpoint by using 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 window, PolarDB automatically scales out or scales up the cluster after the observation window ends. This ensures that the cluster can handle all read and write requests. For example, if the length of the observation window 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 quiescent period, PolarDB continuously tracks whether the trigger conditions for an automatic scale-up or scale-down operation are met. During this period, automatic scale-up or scale-down is not triggered. If a quiescent period and an observation window end at the same time and the CPU utilization reaches the threshold within the observation window, PolarDB triggers automatic scale-out.
  7. Click OK.

Best practices

Troubleshoot high CPU utilization