If your workloads change periodically, such as traffic spikes within specified periods of time, or your workloads are heavy during promotions, you can use the scheduled auto scaling feature of Database Autonomy Service (DAS). This feature enables you to scale up the specifications of your RDS instance in a specific time window to respond to periodic changes in workloads. After the specified scaling period elapses, your RDS instance is automatically restored to its previous specifications. The scheduled auto scaling feature helps you reduce costs and meet your business requirements.
Prerequisites
Your RDS instance must run one of the following MySQL versions and RDS editions:
MySQL 8.0 on RDS High-availability Edition, uses cloud disks, and belongs to the general-purpose instance family.
MySQL 5.7 on RDS High-availability Edition, uses cloud disks, and belongs to the general-purpose instance family.
The balance in your Alibaba Cloud account is sufficient.
A service-linked role for DAS is created. For more information, see AliyunServiceRoleForDAS role.
Usage notes
To scale up a database instance on a regular basis, you must configure a scheduled auto scaling policy for the database instance.
All time-related parameters are displayed in UTC+8. If this time zone is not supported in your region, you must convert the time before you configure the parameters.
You can apply only one auto scaling policy of each mode to a database instance.
Retry intervals are not supported for scheduled auto scaling policies. If a scheduled auto scaling policy fails to be executed, the system does not retry to execute the policy.
If the Duration or Scale-back Time parameter is modified after an instance is scaled up, the instance is scaled back to the previous specifications based on the new time specified by either of the two parameters.
In the following scenarios, the database instance may not be scaled back to its previous specifications even if the Duration or Scale-back Time parameter is specified:
The specifications of the database instance are manually or automatically changed again after the scheduled auto scaling policy is executed. If the instance specifications are different from those specified in the policy, the database instance is not scaled back.
One or more metrics of the database instance do not meet specific standards. For example, the memory of an instance is scaled up from 1 GB to 4 GB based on a scheduled auto scaling policy. If 1 GB of memory has been used before the instance is scaled back, the scale-back operation is not performed because the memory usage increases to 100% during the operation. This ensures the stability and security of your business.
The instance is in a state in which specification changes are not allowed, such as the Changing Specifications or Migrating state.
Examples
DAS performs scaling operations on your instances once or on a regular basis. DAS may scale your instances every day, week, or month. For example, if the peak hours of your business start at 2:00 on the first day of every month and end at 2:00 on the third day of every month, you can use the scheduled auto scaling feature to scale up your instances during peak hours and scale the instances back during off-peak hours.
Billing rules
When you change the specifications of your RDS instance by using the scheduled auto scaling feature, you are charged a specification change fee. For more information, see Specification changes.
Create a scheduled auto scaling policy
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
. 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
. On the page that appears, click Autonomy Service Settings.
In the panel that appears, choose . On the tab that appears, click Add Policy. In the Add Policy panel, configure the following parameters.
Parameter
Description
Policy Name
The name of the policy.
Mode
The mode of the policy. Select Scheduled Auto Scaling from the Mode drop-down list.
Engine Type
The type of the database engine.
Specifications
The specifications of the RDS instance that runs the selected database engine.
Operation
The scaling operation that you can perform. Only Adjust Instance Specifications is supported.
Valid From
The time range during which the policy is effective.
Start time is a required parameter. You must set this parameter to a date later than the current date.
End time is an optional parameter.
If you set the Recurrence parameter to N/A(Execute Only Once), the scheduled auto scaling policy is executed only once and is not subject to the End time parameter.
If you set the Recurrence parameter to Daily, Weekly, or Monthly and leave the End time parameter empty, the scheduled auto scaling policy is repeatedly executed based on the specified cycle. If you specify an end time, the system stops executing the policy after the end time.
Recurrence
The interval at which the scaling operation is performed. Valid values:
N/A(Execute Only Once):
Scaling Start Time: You must configure this parameter.
Duration: You can set this parameter to a positive integer or leave this parameter empty. Unit: hours. This parameter is optional.
If you leave the Duration parameter empty, the RDS instance cannot be scaled back.
If you configure the Duration, the RDS instance can be scaled back to its previous specifications after the specified duration.
Daily:
Scaling Start Time: You must configure this parameter.
Scale-back Time: You must configure this parameter.
If the scaling start time is earlier than the scale-back time, the specified scaling operation starts an ends on the same day.
If the scaling start time is later than the scale-back time, the specified scaling operation starts at the scaling start time on the specified day and ends at the scale-back time of the following day.
NoteThe time specified by the Scale-back Time parameter must be at least 1 hour later than that specified by the Scaling Start Time parameter.
The scaling start time must be at least 1 hour later than the scale-back time of the previous execution of the policy.
If you specify an end time and the end time is set to a date between the scaling start time and scale-back time of the last execution of the policy, the last execution of the policy is not performed.
Weekly:
Scaling Start Time: You must configure this parameter.
Scale-back Time: You must configure this parameter.
If the scaling start time is earlier than the scale-back time, the specified scaling operation starts an ends on the same week.
If the scaling start time is later than the scale-back time, the specified scaling operation starts at the scaling start time in the specified week and ends at the scale-back time of the following week.
NoteThe time specified by the Scale-back Time parameter must be at least 1 hour later than that specified by the Scaling Start Time parameter.
The scaling start time must be at least 1 hour later than the scale-back time of the previous execution of the policy.
If the end time is set to a date between the scaling start time and scale-back time of the last execution of the policy, the last execution of the policy is not performed.
Monthly
Scaling Start Time: You must configure this parameter.
Scale-back Time: You must configure this parameter.
If the scaling start time is earlier than the scale-back time, the specified scaling operation starts an ends on the same month.
If the scaling start time is later than the scale-back time, the specified scaling operation starts at the scaling start time in the specified month and ends at the scale-back time of the following month.
NoteThe time specified by the Scale-back Time parameter must be at least 1 hour later than that specified by the Scaling Start Time parameter.
The scaling start time must be at least 1 hour later than the scale-back time of the previous execution of the policy.
If the end time is set to a date between the scaling start time and scale-back time of the last execution of the policy, the last execution of the policy is not performed.
In the Add Policy panel, click OK.
In the Recommended Policies section, click Apply in the Actions column to add a policy to the RDS instance.
NoteTo modify a policy, click Modify in the Actions column of the policy. In the Update Policy panel, update the policy settings.
If you no longer want to apply a policy to your RDS instance, click Cancel in the Actions column of the policy in the Applied Policies section.
In the Autonomous Function Management panel, click OK.
View the results of scheduled auto scaling
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.
In the left-side navigation pane, choose .
On the Autonomy Center tab, select a time range to view the auto scaling events that occurred in the selected time range.
Click Details in the Auto-Scaling Events section to view the details of scheduled auto scaling events.
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 instance. For more information about the instance types and migration solutions, see Specifications and Migrate data between ApsaraDB RDS for MySQL instances.
References
You can change the specifications of your RDS instance as your business grows. You can also enable the automatic performance scaling feature. This way, the system automatically scales up the instance specifications based on the workloads. For more information, see Change instance specifications and Use the automatic performance scaling feature.