The diagnostics feature of PolarDB for MySQL integrates with Database Autonomy Service (DAS). On the Autonomy Center tab, you can enable the autonomy service. Then, if an exception occurs in a database, DAS automatically performs root cause analysis, gives suggestions, and then performs optimizations and fixes issues. Optimizations are allowed based on your authorization.
The service edition of your PolarDB for MySQL clusters is Cluster Edition or Archive Database. This feature is unavailable for Single Node. For more information about service editions, see Product editions.
Only the PolarDB for MySQL clusters whose product type is pay-as-you-go support automatic scale-out and automatic scale-in. Subscription clusters do not support automatic scale-out or automatic scale-in. For more information, see Purchase a pay-as-you-go cluster.
- Log on to the PolarDB console.
- In the upper-left corner of the console, select the region where the cluster resides.
- On the Clusters page, find the cluster for which you want to enable the autonomy service, and click the cluster ID.
- In the left-side navigation pane, choose .
- On the page that appears, click the Autonomy Center tab.
- In the upper-right corner, click Autonomy Service Settings.
- In the Set dialog box, click the Autonomy Service Settings tab and turn on Enable Autonomy.Note After you enable the autonomy service, capacity evaluation, session analytics, throttling SQL analytics, and snapshots upon exceptions are automatically performed. These features do not cause extra loads to the database.
- Specify the following parameters: Automatic Index Creation and Deletion, Automatic Throttling, Automatic Scale-up/out, and Automatic Scale-down/in.
- Automatic Index Creation and Deletion: After you turn on Enable Autonomy, the SQL Diagnostics feature is automatically enabled. You can click Enable Automatic Index Creation to automatically create indexes and click Enable Automatic Index Deletion to automatically delete indexes.
- Automatic Throttling: You can specify conditions to trigger automatic SQL throttling. If the specified
conditions are met, automatic SQL throttling is triggered.
Note For example, automatic throttling is triggered if the following conditions are met during the time period specified by the Current limiting period parameter (default value: 00:00 to 23:59): The CPU usage is greater than 70%, the number of active sessions is greater than 16, and the duration is at least 2 minutes. In this case, the system automatically starts to check whether the conditions are met again when the automatic throttling is triggered. If the issue is not fixed, the system automatically rolls back the throttling operation. After automatic throttling is triggered, the duration of the throttling operation does not exceed the time specified by the Maximum current limiting time parameter. For more information, see Automatic SQL throttling.
- Automatic Scale-up/out and Automatic Scale-down/in: you can enable these features and customize conditions. Scale-in and scale-out are
automatically triggered when the specified conditions are met.
Parameter Description Auto Scaling-out Specify whether to enable the automatic scale-out feature. Observation Period During the observation period, if the CPU usage exceeds the specified value, PolarDB automatically adds nodes or upgrades the cluster to ensure that the cluster can handle the received read and write requests. CPU Usage The threshold for triggering automatic scale-out. If the CPU Usage is greater than or equal to the specified value, automatic scale-out is triggered. Maximum Specification The upper limit of the specifications to which the cluster can be scaled. After automatic scale-out is triggered, the system upgrades the specifications of the PolarDB cluster to the upper limit step by step. For example, the specifications are upgraded from 4 cores to 8 cores, and then to 16 cores.Note
- If you upgrade a cluster, the existing data in clusters is not affected.
- You may experience PolarDB service interruptions for a few seconds during specification changes. During this time, you cannot perform some operations. Make sure that your applications can automatically reconnect to the cluster.
Maximum Number of Read-only Nodes The maximum number of read-only nodes that can be automatically added to the cluster for auto scaling. After automatic scale-out is triggered, the read-only nodes of the PolarDB cluster are added one by one until the upper limit is reached.Note The automatically added nodes are associated with the default endpoint of the cluster. If you use a custom endpoint, you must set the Automatically Associate New Nodes parameter to specify whether these nodes are automatically associated with the endpoint. For more information about Automatically Associate New Nodes, see Modify or delete a cluster endpoint. Auto Scaling-in Specify whether to enable the automatic scale-in feature.Note After you enable the feature, if the CPU usage is less than 30% for more than 99% of the observation period, automatic scale-in is triggered. The specifications of the PolarDB cluster are scaled to the original specifications step by step. Quiescent Period The minimum interval between two automatic scale-in operations or two scale-out operations. During a quiescent period, PolarDB continuously tracks whether the conditions for triggering automatic scale-out or scale-in are met. However, automatic scale-out or scale-in is not triggered. If a quiescent period and an observation period expire at the same time and the CPU usage reaches the threshold within the observation period, PolarDB automatically triggers auto scaling.
- Click OK.