Database Autonomy Service (DAS) provides the performance snapshot feature. You can use this feature to solve the following issue:

Background information

Assume that a MySQL database reports an alert. The alert indicates that the CPU utilization reaches 90% at 01:00:00 (UTC+8). As a result, the response time for service requests is prolonged. However, when the database administrator logs on to the database for troubleshooting, the system has recovered from the exception. The monitoring data shows only a CPU utilization surge and an increase in the number of active sessions. No slow SQL queries are recorded. In this case, you cannot find the root cause due to a lack of log data and scenario details. The same fault may occur again and impair the service availability. The performance snapshot feature helps you handle this issue and troubleshoot database exceptions. You can set alert triggers or manually trigger the creation of performance snapshots to collect the exception details. After you set alert triggers, performance snapshots are created based on alerts.

Procedure

  1. Log on to the DAS console.
  2. An ApsaraDB RDS for MySQL database instance is connected to DAS and is in the Accessed state.
  3. In the left-side navigation pane, click Instance Monitoring. Find the instance and click its ID to go to the instance details page.
  4. Click Performance Snapshot.
  5. To enable the performance snapshot feature, click the Settings icon that is framed by the red rectangle in the following figure. If no alert rules are configured to monitor the active sessions of MySQL instances, click the link in the Alert Configuration Required message. On the Alert Configuration page, configure the alert settings.
  6. Click OK.
    Note As shown in the preceding figure, a snapshot is created for the ApsaraDB RDS for MySQL instance if the number of consecutive active sessions is greater than or equal to 23.

Performance snapshot

  1. Select the snapshot that you want to view and click Search in the Actions column.
  2. The snapshot details page appears.
    • The Monitoring within Seconds section shows the monitoring data of key metrics based on seconds.
    • The next section shows the following information:
      1. The active session statistics collected within 60 seconds after the performance snapshot feature is enabled. The active session statistics are collected by executing the SHOW FULL PROCESSLIST statement every second. The statistics help you identify the most frequently executed SQL statement, the most time-consuming SQL statement, top users, top sources, top commands, and top sessions.
      2. The full request statistics collected within 60 seconds after the performance snapshot feature is enabled. The statistics can be collected only after you enable the SQL Explorer feature.
      3. The slow query log statistics collected within 60 seconds after the performance snapshot feature is enabled.