Database Autonomy Service (DAS) provides the auto scaling feature for CPU specifications of database instances. DAS can automatically scale up your database instance to handle traffic spikes during peak hours. This can ensure the stability of the database performance. 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 auto scaling feature.

Prerequisites

  • An ApsaraDB RDS for MySQL High-availability Edition instance that uses enhanced SSDs (ESSDs) or an ApsaraDB PolarDB MySQL-compatible edition instance is connected to DAS.
  • The Enable Autonomy Service switch is turned on for the database instance for which you want to enable the auto scaling feature. For more information, see Autonomy center.
  • Your Alibaba Cloud account has sufficient balance to pay for the costs of scaled-up resources.
  • A DAS-linked role is created. For more information, see AliyunServiceRoleForDAS role.
    Note If you do not create a Resource Access Management (RAM) role that is linked to DAS, DAS can automatically create a service-linked role when you enable the auto scaling feature.

Process of auto scaling

Auto scaling
You enable the auto scaling feature for an ApsaraDB RDS for MySQL instance. When the average CPU utilization of the database instance within an observation window exceeds the specified threshold value, DAS automatically scales up the database instance based on the workloads on the instance. The new CPU specification of the database instance cannot exceed the highest specification that you specified. For more information about auto scaling, see What is DAS? After the database instance is scaled up, DAS monitors the CPU utilization of the instance. If the CPU utilization exceeds the specified threshold value 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 highest specification that you specified.
Note DAS cannot automatically scale down the database instance after the instance is scaled up. You can configure the event subscription settings to receive messages that are sent by DAS to notify you to scale down the database instance. For more information, see Event subscription. If the average CPU utilization of your database instance is lower than 30% within an observation window, DAS sends messages to notify you to scale down the database instance. By default, an observation window is set to 30 minutes. You need to manually scale down the database instance. For more information, see Change the specifications of an ApsaraDB RDS for MySQL instance.

Scenarios

After you enable the auto 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 heavy load for approximately 10 hours. After the traffic decreases and the CPU utilization drops to lower than 25%, DAS sends messages to notify you to scale down the database instance to the original specification.

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

Impacts

  • After your database instance is scaled up or scaled down, a transient connection of approximately 30 seconds may occur. Make sure that your application is configured to automatically reconnect to the database instance.
  • If your database instance does not run the database engine 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 service.

Enable the auto scaling feature

  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 for which you want to enable the auto scaling feature 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.
  6. In the Settings dialog box, turn on the Enable Automatic Service switch.
  7. Configure the parameters that are described in the following table.
  8. Click OK.