Database Autonomy Service (DAS) provides automatic scaling for local resources. When a database instance's average CPU utilization reaches a specified threshold within an observation window, DAS uses idle resources on the same host to scale up the instance's CPU cores by a set amount, without changing its original instance specification.
Prerequisites
-
This feature is available for PolarDB for MySQL Cluster Edition (General-Purpose) and Multi-master Cluster (Database/Table) Edition (General-Purpose) instances.
NoteThe 8.0.2 kernel version of PolarDB for MySQL does not support automatic scaling for local resources.
-
The AliyunServiceRoleForDAS role has been created.
Benefits
Automatic scaling for local resources works by relaxing cgroup limits on the local host. Compared with automatic performance scaling, this feature provides the following benefits:
|
Feature |
Automatic scaling for local resources |
Automatic performance scaling |
|
Scalable resources |
Scales up only CPU cores and IOPS. Memory and connections cannot be scaled up. |
Scales up CPU cores, IOPS, memory, and connections. |
|
Execution speed |
Fast:
|
Slower:
|
|
Upgrade process |
Does not involve an instance specification change or cause a connection interruption. |
Requires an instance specification change, causing a brief connection interruption. |
Usage notes
-
This feature is in public preview and is free of charge.
-
After enabling automatic scaling for local resources, disable automatic performance scaling for the same instance to avoid conflicts. If automatic performance scaling is triggered after a local scaling event, the local scale-up is reverted.
NoteOn the instance details page, you can go to the Autonomy Service Settings panel on the right and disable the Auto Storage Expansion feature.
-
A scale-up does not occur if the host has insufficient CPU resources.
-
In a scaled-up state, extreme scenarios, such as a failover, severe host resource shortages, or the scaled-up resources being reclaimed due to conflicts with existing management processes, can occur. Use this feature for short-term analysis to determine peak CPU requirements for core instances. For long-term stability, upgrade the instance specification based on peak CPU usage.
Procedure
Log on to the DAS console.
-
Create a policy for automatic scaling for local resources.
-
Create a policy from the Management and Settings page.
-
In the navigation pane on the left, click Resource Management > Auto Scaling Settings.
-
In the Auto Scaling Policies section, click Add Policy. On the Add Policy page, configure the following parameters:
Table 1. Parameters
Parameter
Description
Policy Name
The name of the policy.
Mode
Select Automatic Scaling for Local Resources.
Engine Type
The database engine type. Only PolarDB for MySQL is supported.
Specifications
The specification of the selected database engine.
Average CPU Utilization
The scale-up trigger threshold. A node is automatically scaled up when its average CPU utilization reaches or exceeds this value.
Scale-up Observation Window
The time window during which the system observes instance performance. If a node's average CPU utilization reaches the trigger threshold within this window, the system automatically scales up the node.
CPU Scale-up Step Size
The number of CPU cores to add in each scale-up operation. Valid values: integers from 1 to 31.
For example, if a 4-core instance has a CPU Scale-up Step Size of 2, it is scaled up to 6 cores. If the average CPU utilization still meets the trigger condition after the scale-up, the system continues to scale up the instance in steps until the upper limit is reached.
NoteAfter a scale-up, the maximum number of CPU cores for an instance is four times its original core count, capped at 32 cores. For example, a 4-core instance can be scaled up to a maximum of 16 cores.
Scale-down Observation Window
The observation window for a scale-down. An automatic scale-down is triggered if a scaled-up node's CPU utilization remains below 30% for over 99% of this window.
Each scale-down operation reduces the CPU core count by the configured scale-up step size until the instance returns to its original specification.
-
On the Apply Policies page, select the target database instances, and click
. -
Click OK to apply the policy to the selected database instances.
Alternatively, in the Auto Scaling Policies section, find the target policy and click Apply in the Actions column.
-
-
Create a policy from the Autonomy Service Settings panel of an instance in the Autonomous Function Management page.
-
In the navigation pane on the left, click Intelligent O&M Center > Instance Monitoring.
-
Find the target instance and click its ID to open the instance details page.
-
In the upper-right corner of the page, click Autonomy Service Settings.
-
On the , click Add Policy and configure the parameters as described in Parameters to create a policy for automatic scaling for local resources.
-
In the Recommended Policies section, find the policy that you want to add, and click Apply in the Actions column.
Note-
In the Actions column of the policy, click Modify. On the Update Policy tab, modify the policy.
-
To remove a policy from the instance, find it in the Applied Policies section and click Cancel Policy in the Actions column.
-
-
Click OK.
-
Configure an Alert Template to receive notifications for automatic scaling for local resources events.
The system recommends an alert template and adds the corresponding alert rules for autonomy events. You can follow the prompts to complete the configuration.
Note-
If you have already configured an alert template for the instance, follow the prompts to add the required alert rules for autonomy events.
-
If you need to configure an alert template and alert rules yourself, see Configure alert templates and Configure alert rules.
-
-
Select an Alert Contact Group to receive notifications.
-
Click Add Contact to add a new alert contact.
-
Click Add Contact Group to create a new alert contact group.
-
Click Modify or Remove next to a contact to edit or delete it.
For more information, see Manage alert contacts.
-
-
Click Submit Configuration and confirm the alert settings in the resulting dialog box.
-
-
View local auto-scaling results
-
In the navigation pane on the left, click Intelligent O&M Center > Instance Monitoring.
-
Find the target instance and click its ID to open the instance details page.
-
In the navigation pane on the left, click Autonomy Center.
-
On the Autonomy Center page, view the Auto Scaling Events within the selected time range.
-
Click Details for an Auto Scaling Events entry to view its details.
The auto-scaling event notification panel displays basic information such as the event name, time, severity level, and duration.