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
Tair (Redis OSS-compatible)
A service-linked role is created for DAS. 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 Autonomous Function Settings tab of the Autonomous Function Management panel.Autonomy Service Settings
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 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 the "Table 1. Parameters" section of 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.
In the Alert Configuration section, configure an alert template and subscribe to alert notifications. This helps you understand the status of a prediction-based auto 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 database instance, you must add alert rules for the required autonomy event to the alert template as prompted.
For more information about how to configure an alert template and alert rules for your database instance, see Configure alert templates and Configure alert rules.
In the Select Contact Group section, 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.
Click Submit Configuration. In the dialog box that appears, confirm the configuration.
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 page, select a time range to view the auto scaling events that occurred within the selected 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 change the specifications of a cluster
Tair (Redis OSS-compatible): Change the configurations of an instance