Database Autonomy Service (DAS) provides the prediction-based auto scaling feature to handle business growth and heavy database loads. This feature allows DAS to predict the metric values of an instance for the next 24 hours based on the historical data of the instance over the last 10 days. This feature also provides suggestions if the value of the prediction metric reaches the threshold. This topic describes how to create a prediction-based auto scaling policy.
Prerequisites
The database instance that you want to manage is of one of the following types:
ApsaraDB RDS for MySQL
PolarDB for MySQL
ApsaraDB for Redis
A service-linked role for DAS is created. For more information, see AliyunServiceRoleForDAS role.
Procedure
Log on to the DAS console.
Create a prediction-based auto scaling policy.
Create a prediction-based auto scaling policy on the Management and Settings page.
In the left-side navigation pane, click Management and Settings.
In the Auto Scaling Policies section, click Add Policy. In the Add Policy panel, configure the parameters that are described in the following table.
Table 1. Parameters
Parameter
Description
Policy Name
The name of the policy.
Mode
The mode of the policy. Select Prediction-based Auto Scaling.
NoteIn this mode, DAS provides scaling suggestions but does not perform scaling operations.
Engine Type
The type of the database engine.
Metric Type
The type of the metric whose value you want to predict. If you select RDS MySQL or PolarDB MySQL as the engine type, only CPU Utilization (%) is available for the Metric Type parameter.
If you select Redis as the engine type, only Memory Usage (%) is available for the Metric Type parameter.
Destination Value
The predefined value of the prediction metric. If the predicted value of a metric is greater than or equal to the predefined value, scaling suggestions are provided.
Click Next Step. In the Apply Policies dialog box, select the database instances to which you want to apply the policy and click the icon.
Click Confirm to apply the policy to the selected database instances.
Alternatively, you can perform the following steps to apply the policy to a database instance: In the Auto Scaling Policies section, find the policy that you created and click Apply in the Actions column. In the Apply Policies dialog box, select the database instances to which you want to apply the policy, click the rightwards arrow, and then click Confirm.
Create a prediction-based auto scaling policy on the Autonomy Service Settings tab of the Autonomous Function Management panel.
In the left-side navigation pane, click Instance Monitoring.
On the Instance Monitoring page, find the database instance for which you want to create a prediction-based auto scaling policy and click the instance ID.
On the instance details page, click Autonomy Service Settings in the upper-right corner.
On the Autonomous Function Settings tab of the Table 1. Parameters section of the "Automatic scaling for local resources" topic.
panel, click the Auto Scaling tab. In the Applied Policies section, click Add Policy to create a prediction-based auto scaling policy for the database instance. For more information, see theIn the Recommended Policies section, find the policy that you created and click Apply in the Actions column.
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 instance, click Cancel in the Actions column of the policy in the Applied Policies section.
Click OK.
View the results of prediction-based auto scaling
In the left-side navigation pane of the DAS console, click Instance Monitoring.
On the Instance Monitoring page, find the database instance for which prediction-based auto scaling is enabled and click its ID.
In the left-side pane of the instance details page, click Autonomy Center.
On the Autonomy Center tab, specify a time range and view the auto-scaling events that occurred within the specified time range.
Click Details in the Event: Database Workload Prediction section to view the details of prediction-based auto scaling.
References
You can perform scaling operations on your database instances based on the provided suggestions. For more information about how to perform scaling operations, see the following topics:
ApsaraDB RDS for MySQL: Change instance specifications
PolarDB for MySQL: Manually upgrade or downgrade a PolarDB cluster
ApsaraDB for Redis: Change the configurations of an instance