Database Autonomy Service (DAS) provides the inspection and scoring feature to inspect and score the health status of your database instances on a regular basis. This can help you ensure the status of your database instances. This topic describes how to use the inspection and scoring feature.

Prerequisites

  • Make sure that your database instances belong to the following types:
    • ApsaraDB RDS for MySQL instances
    • self-managed MySQL databases
    • ApsaraDB PolarDB MySQL-compatible edition instances
    • ApsaraDB for Redis instances
  • Your database instances are connected to DAS and are in the Accessed state. For more information about how to connect database instances to DAS, see Connect an Alibaba Cloud database instance to DAS.

Configure inspection and scoring

  1. Log on to the DAS console.
  2. In the left-side navigation pane, click Inspection and Scoring.
  3. On the Instance Inspection and Scoring page, configure inspection and scoring for your database instances.
    • Enable automatic inspection and scoring.
      1. In the upper-right corner of the page, click Settings.
      2. In the Enable Inspection and Scoring dialog box that appears, select the types of database instances for which you want to enable automatic inspection and scoring and click Confirm. ss
        Note After the automatic inspection and scoring feature is enabled, DAS scores the specified types of database instances that are connected to it once a day.
    • Configure an inspection and scoring task for specified database instances
      1. On the Instance Inspection and Scoring page, click the tab that contains the database instances for which you run inspection and scoring and then click Initiate inspection in the upper-right corner of the tab.
      2. In the Inspection instance dialog box that appears, select one or more instances and configure the Select inspection time parameter. ss
      3. Click ss and click Confirmation.

View the results of inspection and scoring

  1. After you enable the inspection and scoring feature, on the Instance Inspection and Scoring page, you can enter the ID, IP address, or alias of a database instance to search for the database instance. You can specify a period of time to view the inspection and scoring results that are generated within the specified time range. You can also export the inspection and scoring results.
    s
    Note On the Instance Inspection and Scoring page, you can view the score of the health condition of a database instance and the statistics of each inspected item.
  2. Click Deduction Details in the Operation column to view the details of score deduction.
  3. Click Report in the Operation column to view the details of the report in the Scoring Report panel.
    s

Scoring rules

  • MySQL
    Item Description Sub-item Condition Deducted points
    CPU Utilization (cpuUsage) The average CPU utilization during a day. If an instance has multiple CPU cores, the system calculates the CPU utilization of each core and then calculates the average CPU utilization of all cores. Major 70% <= cpuUsage <= 80% 1 + (cpuUsage - 0.7) * 20
    Critical cpuUsage >= 80% min[3 + (cpuUsage - 0.8) * 30, 10]
    Memory Usage (memUsage) The average memory usage during a day. Major 80% <= memUsage <= 90% 1 - (memUsage - 0.8) * 20
    Critical memUsage > 0.9 min[(memUsage - 0.9) * 50, 10]
    Space Usage (Space Usage) The storage usage is calculated based on the following formula: Storage usage = Average used storage during a day/Total storage × 100% Available days availableDays <= 30 15 - availableDays/3
    The number of large tables bigTableCount > 0 min(bigTableCount, 15)
    Connection Usage (connectionRate) The connection usage is calculated based on the following formula: Connection usage = Average number of connections during a day/Maximum number of connections allowed at a point in time × 100% Major 70% <= connectionRate <= 80% 1
    Critical connectionRate > 80% 3
    IOPS Usage (iopsUsage) The IOPS usage is calculated based on the following formula: IOPS usage = Average IOPS during a day/Maximum IOPS allowed × 100% Major 70% < iopsUsage < 90% 3
    Critical iopsUsage > 90% 5
    ThreadRunning (threadRunning) The number of active sessions generated in one day. Major threadRunning > min(2 * cpuCores + 8,64) 3
    Critical threadRunning > min(4 * cpuCores + 8,96) 9
    Slow SQL Statements (slowSqlCount) The number of slow SQL statements generated in one day.
    Note You can click the number to view the five slow SQL statements that are most frequently executed.
    Minor 0 < slowSqlCount < 100 1 + (slowSqlCount - 10)/30
    Major 100 <= slowSqlCount < 500 4 + (slowSqlCount - 100)/30
    Critical slowSqlCount >= 500 min[18 + (slowSqlCount - 50)/30, 30)]
    SQL security audit (sqlInjectionCount) The number of high-risk SQL statements and the number of SQL injection attacks. High-risk SQL statements riskSqlCount > 0 min(riskSqlCount, 5)
    SQL injection sqlInjectionCount > 0 min(sqlInjectionCount, 5)
    Deadlock Indicates whether a deadlock occurs during a day. Yes Yes 3
  • Redis
    Item Description Sub-item Condition Deducted points
    CPU Utilization (cpuUsage) The average CPU utilization during a day. If an instance has multiple CPU cores, the system calculates the CPU utilization of each core and then calculates the average CPU utilization of all cores. Major 70% <= cpuUsage <= 80% 1 + (cpuUsage - 0.7) * 20
    Critical cpuUsage >= 80% min[3 + (cpuUsage - 0.8) * 30, 10]
    Memory Usage (memUsage) The average memory usage during a day. Major 80% <= memUsage <= 90% 1 + (memUsage - 0.8) * 20
    Critical memUsage > 0.9 min[(memUsage - 0.9) * 50, 10]
    Connection Usage (connectionRate) The connection usage is calculated based on the following formula: Connection usage = Average number of connections during a day/Maximum number of connections allowed at a point in time × 100% Major 70% <= connectionRate <= 80% 1
    Critical connectionRate > 80% 3
    Traffic usage (FlowRate) The traffic usage is calculated based on the following formula: Traffic usage = Average traffic during a day/Maximum traffic allowed at a point in time × 100% Major 80% <= FlowRate <= 85 (Both inbound traffic and outbound traffic count.) 1
    Critical flowRate > 85% 3
    Critical iopsUsage > 90% 5
    Hotkeys (HotKey) The information about hot keys appears. Yes Yes 3
    Slow SQL Statements (slowSqlCount) The total number of slow SQL statements generated in one day. If you click the number, you can view the five slow SQL statements that are most frequently executed. Minor 0 < slowSqlCount < 100 1 + (slowSqlCount - 10)/30
    Major 100 <= slowSqlCount < 500 4 + (slowSqlCount - 100)/30
    Critical slowSqlCount >= 500 min[18 + (slowSqlCount - 50)/30, 30)]

Related API operations

GetInstanceInspections