Database Autonomy Service (DAS) provides the performance snapshot feature. You can use this feature to solve the following issue:
Assume that a MySQL database reports an alert. The alert indicates that the CPU usage 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 usage 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 negatively affect the service availability.
The performance snapshot feature helps you handle this issue and troubleshoot database exceptions. You can specify alert triggers or manually trigger the creation of performance snapshots to collect the exception details. After you specify alert triggers, performance snapshots are automatically created based on alerts.
You remain logged on to the DAS console.
The target MySQL database instance is connected to DAS, and the target database instance is in the Accessed state. For more information about the procedures, see Connect ApsaraDB for RDS database instances and Connect user-created database instances.
In the left-side navigation pane, click Instance Monitoring. Find the target database instance and click the instance ID. On the page that appears, you can view the performance details of the instance.
In the left-side navigation pane, click Performance Snapshots.
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 that is framed by the red rectangle in the following figure. On the page that appears, configure the alert settings.
After the alert settings are configured, click OK.
On the Performance Snapshots page, find the target snapshot, and click View in the Actions column.
On the page that appears, you can view the snapshot details.
The Monitoring within Seconds section shows the monitoring data of key metrics based on seconds.
The next section shows the following information:
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 statements, the most time-consuming SQL queries, top users, top sources, top commands, and top sessions.
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 insight feature.
The slow query log statistics collected within 60 seconds after the performance snapshot feature is enabled.