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.

Prerequisites

The cluster must be of PolarDB for MySQL Cluster Edition, Multi-master Cluster (Database/Table) Edition, or X-Engine Edition. This feature is not supported on the cluster of Single Node Edition. For more information, see Overview.

Precautions

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.

Procedure

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region in which the cluster that you want to manage is deployed.
  3. On the Clusters page, find the cluster for which you want to enable the autonomy service, and click the cluster ID.
  4. In the left-side navigation pane, choose Diagnostics and Optimization > Diagnosis.
  5. On the page that appears, click the Autonomy Center tab.
    Autonomy Center
  6. In the upper-right corner, click Autonomy Service Settings.
    Autonomy Service Settings
  7. In the Autonomous Function Management dialog box, click the Autonomous Function Settings tab.
    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.
    Enable the autonomy service
  8. 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 Only feature is automatically enabled.
      • SQL diagnosis only: DAS performs daily diagnostics on SQL statements and provides index optimization suggestions. However, DAS does not create indexes on your cluster.
      • SQL diagnosis and automatic index creation: DAS performs daily diagnostics on SQL statements, provides index optimization suggestions, and then creates indexes on your cluster based on these suggestions.
        Note Automatic SQL optimization creates indexes only during the O&M window of the cluster.
    • 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.
      ParameterDescription
      Auto Scaling-outSpecifies whether to enable the auto scale-out feature.
      Observation PeriodIf the CPU utilization is greater than or equal to the specified value during the observation period, PolarDB automatically adds nodes or upgrades the specifications of your cluster after the observation period expires. This ensures that the cluster can handle the incoming read and write requests. For example, if the observation period is 5 minutes and the time required to complete a scaling activity is 10 minutes, you must wait 15 minutes before you can check the scaling result.
      CPU UsageThe threshold that is used to trigger upgrades or scale-out activities. If the CPU Usage is greater than or equal to the specified value, an auto scale-out activity is triggered.
      Maximum SpecificationThe highest specifications to which a cluster can be upgraded. After an upgrade is triggered, the specifications of a PolarDB cluster is upgraded tier by tier until the highest specifications are applied. For example, the cluster is upgraded from 4 cores to 8 cores, and then to 16 cores.
      Maximum Number of Read-only NodesThe maximum number of read-only nodes that can be automatically added to the cluster. After a scale-out activity is triggered, read-only nodes are automatically added to a PolarDB cluster one after another until the specified upper limit is reached.
      Note The nodes that are automatically added are associated with the default cluster endpoint. If the cluster uses a custom endpoint, you must specify whether to associate these nodes with the endpoint by specifying the Automatically Associate New Nodes parameter. For more information about Automatically Associate New Nodes, see Configure Polar Proxy.
      Auto Scaling-inSpecifies whether to enable the auto scale-in feature.
      Note After you turn on Auto Scaling-in, if the CPU utilization remains at less than 30% for more than 99% of the silent period, an automatic scale-in activity is triggered after the silent period ends. The specifications of the PolarDB cluster are scaled in to the original specifications in small increments.
      Quiescent PeriodThe minimum interval between two scaling activities. During a silent period, PolarDB monitors the resource usage of a cluster but does not trigger scaling activities. If a quiescent period and an observation period end at the same time and the CPU utilization reaches the threshold value within the observation period, PolarDB automatically triggers the auto scaling operation.
  9. Click OK.