This topic provides an overview of the Active Session function in RDS for MySQL. With this function, you can view sessions, collect statistics of sessions, analyze SQL statements, and optimize SQL statement execution.
The MySQL version and RDS edition are as follows:
- MySQL 8.0 High-availability Edition
- MySQL 5.7 High-availability Edition/Enterprise Edition
- MySQL 5.6
- MySQL 5.5
View the Active Session page
- Log on to the RDS console.
- Select the target region.
- Find the target RDS instance and click the instance ID.
- In the left-side navigation pane, choose .
Overview of the Active Session page
- Session management
You can manage sessions as follows:
- Refresh sessions.
Click Refresh. The system immediately displays all current sessions.Note
- You can turn on the Auto Refresh switch. Then, the system automatically refreshes the session data once every 30 seconds.
- By default, the system displays active sessions. You can turn on the Display All switch to view all sessions.
- Export all sessions.
Click Export to save the session data to your computer.
- Terminate sessions.
Select a session and click Kill Selected. In the dialog box that appears, click Confirm to terminate the selected session.Note
- You can hold the Shift key to select more than one session.
- You can click Kill All Sessions to terminate all sessions.
- Refresh sessions.
- 10-second SQL analysis
Click Analysis. The system runs the
show processlistcommand once every second within a 10-second period and analyzes all results. Based on the results, you can identify which SQL statements are run for a large number of times and whether slow SQL statements occur within the 10 seconds.
- SQL execution optimization
Select the sessions that have SQL statements in the corresponding SQL column, and then click Optimize to view the SQL statement diagnosis and optimization information.Note You can purchase a database expert service. This service provides functions, such as emergency handling, health diagnostics, performance optimization, escort, and Oracle migration, that are beyond the service scope of the cloud database product.
- Sessions statistics
The Session Statistics section displays session statistics by category.