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.

Prerequisites

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

  1. Log on to the RDS console.
  2. Select the target region.Select a region
  3. Find the target RDS instance and click the instance ID.
  4. In the left-side navigation pane, choose CloudDBA > Active Session.Active Session page

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.
      Refresh/Auto Refresh/Display All
    • Export all sessions.

      Click Export to save the session data to your computer.

      Export sessions
    • 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.
      Terminate sessions
  • 10-second SQL analysis
    Click Analysis. The system runs the show processlist command 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.10-second SQL analysis
  • 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.Session Statistics section