As your business grows, data volume increases, and new services or new features are released, the database traffic increases and computing resources become insufficient. Increasing the database computing resources, such as CPU cores and memory resources, is an effective method to solve these problems. Database Autonomy Service (DAS) provides the automatic performance scaling feature for your ApsaraDB RDS for MySQL instance to handle traffic spikes during peak hours. When traffic decreases, DAS automatically scales down the instance specifications to prevent inefficient use of resources.
Prerequisites
Your RDS instance is a standard RDS instance that runs RDS High-availability Edition and uses a dedicated instance type and cloud disks or a standard RDS instance that runs RDS High-availability Edition and uses a general-purpose instance type and local disks. The automatic performance scaling feature is not supported for YiTian RDS instances (original ARM architecture).
NoteThe automatic performance scaling feature is not supported for RDS instances that use instance types and run RDS editions different than the preceding ones. If the instance type of your RDS instance does not meet the preceding prerequisite, you must change the instance type to enable the automatic performance scaling feature. For information about how to change the instance type of an RDS instance, see Change instance specifications.
The balance in your Alibaba Cloud account is sufficient.
A service-linked role for DAS is created. For more information, see AliyunServiceRoleForDAS role.
NoteIf the role does not exist, a service-linked role is automatically created for DAS when you enable the automatic performance scaling feature.
Automatic performance scaling process
Automatic scale-up
After you enable the automatic scale-up feature for your RDS instance, DAS performs automatic scale-up based on the instance type when the average CPU utilization of the RDS instance reaches the specified threshold within an observation window.
RDS instances that run RDS High-availability Edition and use a dedicated instance type and cloud disks
DAS automatically selects specifications within the specified ranges to scale up an RDS instance based on the instance workloads. After the RDS instance is scaled up, DAS monitors the CPU utilization of the RDS instance. If the CPU utilization exceeds the specified threshold again, DAS scales up the RDS instance again. This process is repeated until the RDS instance is scaled up to the maximum specifications that you specified.
RDS instances that run RDS High-availability Edition with local disks and use general-purpose instance types and RDS instances that run RDS Enterprise Edition and use general-purpose instance types
DAS doubles the number of CPU cores. For example, if the original number of CPU cores is 4, DAS increases the number of CPU cores to 8 after a scale-up. The IOPS of the RDS instance also increases. The IOPS increases by 1,000 for every CPU core added. If the CPU resources of a host are insufficient, scale-up operations cannot be performed.
NoteDAS increases the number of CPU cores only to twice the original number, but cannot further increase the number. For example, after the number of CPU cores is increased to 8, it cannot be increased to 16.
Automatic scale-down
The system rolls back the instance specifications to the original specifications only when an automatic scale-up is performed after the automatic scale-down feature is enabled. This applies if specific requirements are met. If an automatic scale-up is performed before the automatic scale-down feature is enabled, the system does not roll back the instance specifications to the original specifications even after the automatic scale-down feature is enabled.
RDS instances that run RDS High-availability Edition and use cloud disks
After you select Automatic Scale-down/in, an automatic scale-down is triggered after a cooldown period ends if the CPU utilization of your RDS instance is lower than 30% for longer than 99% of a scale-down observation window. The specifications of the RDS instance are scaled down to the original specifications in small increments.
ImportantA scale-down observation window equals
the value of the Observation Window parameter plus 10 minutes
. For example, if you set the duration of an observation window to 30 minutes, the duration of a scale-down observation window is 40 minutes.If your RDS instance runs RDS High-availability Edition with cloud disks, the automatic scale-down feature can stably run on a new architecture. If the value of the kindCode parameter for the RDS instance is 18, the RDS instance uses a new architecture. You can call an operation to query the architecture of an RDS instance. For more information, see DescribeDBInstanceAttribute.
RDS instances that run RDS High-availability Edition with local disks and use general-purpose instance types and RDS instances that run RDS Enterprise Edition and use general-purpose instance types
If the CPU utilization of your RDS instance is lower than 30% for longer than 99% of a specified scale-down observation window, DAS scales the IOPS and the number of CPU cores of the RDS instance down to the original specifications.
After you enable the automatic performance scaling feature for your RDS instance, DAS monitors the RDS instance based on the most recent parameter settings. When the RDS instance meets the conditions for automatic scale-up or scale-down, DAS scales up or down the instance.
Billing methods
RDS instances that run RDS High-availability Edition with local disks and use general-purpose instance types and RDS instances that run RDS Enterprise Edition and use general-purpose instance types: You are charged based on the pay-as-you-go billing method. Fees are deducted once every hour.
Fee calculation formula: (Fee per CPU core × Number of CPU cores added) × Scale-up duration in minutes
RDS instances that run RDS High-availability Edition and use cloud disks: You are charged based on the instance type after scale-up. The scale-up pricing varies based on the instance configurations, such as the region and the new specifications. For more information, visit the ApsaraDB RDS buy page.
Example
After you enable the automatic performance scaling feature for a database instance, DAS automatically scales up the database instance during peak hours. This doubles the read/write throughput and lowers 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 scales the database instance back to the original specifications.
This way, DAS manages your database instance to handle traffic spikes during peak hours and ensures the stability of your business.
Impacts
If your RDS instance runs RDS High-availability Edition and uses cloud disks, an instance switchover may occur during a specification change. Make sure that your application is configured to automatically reconnect to the RDS instance. For more information about the impacts of an instance switchover, see Impacts of an instance switchover.
If your RDS instance does not run the latest minor engine version, the system updates the minor engine version of the RDS instance to the latest version during a specification change. This ensures the performance and stability of your database service.
The scaling operation is performed only on the primary RDS instance. If a primary/secondary switchover is triggered after the primary RDS instance is scaled up, one of the following situations occurs:
If the primary RDS instance (original secondary RDS instance) meets the conditions to trigger a scale-up or a scale-down, DAS performs the scaling operation on the primary RDS instance.
If the secondary RDS instance (original primary RDS instance) meets the conditions to trigger a scale-down, DAS scales the secondary RDS instance down to the original specifications.
Procedure
Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
Use one of the following methods to go to the Autonomous Function Management panel:
In the left-side navigation pane, choose Autonomy Services > Diagnostics. On the page that appears, click the Autonomy Center tab. On the Autonomy Center tab, click Autonomy Service Settings.
In the left-side navigation pane, choose Autonomy Services > Dashboard. On the Dashboard tab of the page that appears, click Autonomy Service Settings.
On the Autonomous Function Settings tab of the Autonomous Function Management panel, enable the autonomy service.
On the Optimization and Throttling tab, configure the following parameters.
If your RDS instance runs RDS High-availability Edition with cloud disks, select Automatic Performance Scaling. If your RDS instance runs RDS High-availability Edition with local disks and uses a general-purpose instance type or the RDS instance runs RDS Enterprise Edition and uses a general-purpose instance type, select Automatic Resource Elasticity.
Instance category
Parameter
Description
RDS instances that run RDS High-availability Edition and use a dedicated instance type and cloud disks
Observation Window
The period of time during which you want to observe the performance of the RDS instance. DAS checks the average CPU utilization of the RDS instance within the observation window at specific intervals. If the average CPU utilization reaches the specified threshold, automatic scale-up is triggered.
ImportantA scale-down observation window equals
the value of the Observation Window parameter plus 10 minutes
. For example, if you set the duration of an observation window to 30 minutes, the duration of a scale-down observation window is 40 minutes.Maximum Specifications
The maximum specifications to which DAS can scale up the RDS instance. If the CPU utilization of the RDS instance reaches the specified threshold, DAS scales up the RDS instance. If the CPU utilization of the RDS instance reaches the specified threshold again during the next observation window, DAS scales up the RDS instance again. This process is repeated until the RDS instance is scaled up to the maximum specifications that you specified.
Automatic Scale-down/in
After you select Automatic Scale-down/in, automatic scale-down is triggered after a cooldown period ends if the CPU utilization of your RDS instance is lower than 30% for longer than 99% of a scale-down observation window. The specifications of the RDS instance are scaled down to the original specifications in small increments. A scale-down observation window equals
the value of the Observation Window parameter plus 10 minutes
.Quiescent Period
The minimum interval between two automatic scale-up or scale-down operations, which is referred to as a cooldown period. During a cooldown period, DAS monitors the CPU utilization of the RDS instance, but does not trigger automatic scale-up or scale-down even if the specified conditions are met. If a cooldown period and an observation window end at the same time and the average CPU utilization within the observation window reaches the specified threshold, DAS automatically triggers a scale-up or scale-down.
RDS instances that run RDS High-availability Edition with local disks and use general-purpose instance types and RDS instances that run RDS Enterprise Edition and use general-purpose instance types
Scale-up Observation Window
The period of time during which you want to observe the performance of the RDS instance after a scale-up. DAS checks the average CPU utilization of the RDS instance within the observation window at specific intervals. If the average CPU utilization reaches the specified threshold, automatic scale-up is triggered.
Scale-down Observation Window
The period of time during which you want to observe the performance of the RDS instance after a scale-down. DAS checks the CPU utilization of the RDS instance within the observation window at specific intervals. If the CPU utilization is lower than 30% for more than 99% of the observation window, automatic scale-down is triggered.
Click OK.
Optional. In the Alert Configuration section, configure an alert template and subscribe to alert notifications. This helps you understand the status of an automatic performance scaling task at the earliest opportunity.
The system recommends an alert template and adds alert rules for the required autonomy events in the alert template. You can configure the alert template as prompted.
NoteIf you have configured an alert template for your RDS instance, you must add alert rules for the required autonomy events to the alert template as prompted.
If you have not configured an alert template for your RDS instance but you want to configure one, you can configure the alert template by following the instructions provided in Configure alert templates and Configure alert rules.
In the Select Alert Contact Group step, select an alert contact group.
Click Add Contact to add an alert contact.
Click Create Contact Group to create an alert contact group.
Find the alert contact that you want to manage and click Edit or Remove in the Actions column to modify or delete information about the alert contact.
For more information, see Manage alert contacts.
In the Associate with Resources step, confirm the associated resources.
Click Submit Configuration. In the dialog box that appears, confirm the configuration.
FAQ
I want to scale up my RDS instance, but the specifications of the RDS instance have reached the upper limit. What do I do?
We recommend that you purchase an RDS instance that runs a higher RDS edition. For example, you can purchase an ApsaraDB RDS for MySQL instance that runs RDS High-availability Edition and uses a dedicated instance type. The dedicated instance family supports up to 104 CPU cores and 768 GB of memory. Then, migrate your RDS instance to the new RDS instance. For more information about the instance types and migration solutions, see Specifications and Migrate data between ApsaraDB RDS for MySQL instances.
References
If traffic peaks occur within a fixed time period, you can use the scheduled auto scaling feature to configure policies and scale up the specifications of your RDS instance on a regular basis. After the specified scaling period elapses, your RDS instance is automatically restored to its previous specifications. For more information, see Use the scheduled auto scaling feature.
If the instance type of your RDS instance does not support the automatic performance scaling feature, you can use the following methods:
You can change the specifications of an RDS instance, including scaling up and down specifications. For more information, see Change instance specifications.
You can change the instance type to meet the requirements for automatic performance scaling. For more information, see Change instance specifications.