PolarDB-X allows you to view instance sessions and statistics information about instance sessions. When an alert is generated due to an rapid increase in CPU utilization, the number of active sessions, or the response time of your PolarDB-X instance, you can use the 10-second SQL analysis feature to analyze the SQL statements that are executed within a 10-second time window on your instance in real time.

Manage sessions

  1. Log on to the PolarDB-X console.
  2. In the top navigation bar, select the region where the instance is deployed.
  3. On the Instance List page, click the PolarDB-X 2.0 tab.
  4. On the page that appears, click the ID of the instance.
  5. In the left-side navigation pane, choose Diagnosis and optimization > Instance session. 456789
  6. In the Instance session section, you can view the information about sessions. You can also select sessions and click Kill Selected to close the selected sessions. 456789
  7. In the Session Statistics section, you can view statistics by client or namespace.
    Note The statistics information includes the total number of sessions, the total number of active sessions, the maximum session duration in seconds, the number of sessions that are active for more than 3s, and the number of queries that do not use indexes.

10-second SQL analysis

The 10-second SQL analysis feature allows you to analyze SQL statements that are executed within a 10-second time window on your instance in real time. When you perform a 10-second SQL analysis on a PolarDB-X instance, the system executes the SHOW PROCESSLIST statement at an interval of 1s within a 10-second time window. Then, the system analyzes the returned result sets. The analysis result shows the SQL statements that are most frequently executed and whether slow SQL queries exist within the 10-second time window.

  1. Log on to the PolarDB-X console.
  2. In the top navigation bar, select the region where the instance is deployed.
  3. On the Instance List page, click the PolarDB-X 2.0 tab.
  4. On the page that appears, click the ID of the instance.
  5. In the left-side navigation pane, choose Diagnosis and optimization > Instance session.
  6. On the page that appears, click 10s SQL Analysis. 456789
  7. After 10s, you can view the SQL statements that are most frequently executed and whether slow SQL queries exist within this 10-second time window. 456789