The Diagnosis feature of PolarDB for MySQL provides the session management and real-time monitoring services. You can view diagnosis results in charts and tables.

Prerequisites

  • The cluster version must be PolarDB for MySQL 5.6 or 8.0.
  • You must authorize the cluster account when you use the Diagnosis feature for the first time. For more information, see Authorization.

Authorization

  1. Log on to the ApsaraDB for PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster is located.
  3. Click the ID of the cluster.
  4. In the left-side navigation pane, choose Diagnostics and Optimization > Diagnosis.
  5. Enter the Database Account and Password, and click Authorize.
    Authorization
  6. Click OK after you authorize the account to go to the Active Sessions tab.

Session management

The Active Sessions tab provides you with the session viewing and statistics, SQL statement analysis and optimization features.

  1. Log on to the ApsaraDB for PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster is located.
  3. Click the ID of the cluster.
  4. In the left-side navigation pane, choose Diagnostics and Optimization > Diagnosis.
    Active Sessions
  5. Perform the following operations on the Active Sessions tab:
    • SQL optimization
      Select sessions that contain SQL statements in the SQL column and click Optimize to view the optimization suggestions of SQL diagnosis.
      Note You can also click Expert Service to purchase Database Expert Service. Database Expert Service provides professional database services that are not provided by ApsaraDB for PolarDB, for example, emergency solutions, health diagnosis, performance optimization, security, and Oracle migration.
    • 10s SQL analysis
      Click Analysis. The system executes the SHOW PROCESSLIST statement within a 10-second window and analyzes all result sets. You can view the most executed SQL statements and whether slow SQL statements exist within that 10-second window.SQL Analysis
    • Refresh sessions

      Click Refresh to query the current sessions.

      Note
      • You can turn on Auto Refresh. The sessions are refreshed every 30 seconds.
      • By default, only currently active sessions are displayed. To display all sessions, turn on Display All.
    • Export all sessions

      Click Export All Sessions to save and view sessions.

    • Kill sessions
      • Select one or more sessions that you want to kill and select Kill Selected. In the message that appears, click OK to kill the selected sessions.
        Note You can hold the Shift key to select multiple sessions.
      • Click Kill All Sessions to kill all sessions.
    • View session statistics
      You can view session statistics at the lower part of the page.Session statistics

Real-time monitoring

You can view the QPS, TPS, connections, and network traffic of a cluster in real time.

  1. Log on to the ApsaraDB for PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster is located.
  3. Click the ID of the cluster.
  4. In the left-side navigation pane, choose Diagnostics and Optimization > Diagnosis.
  5. Click the Real-time Monitoring tab.
  6. You can view the real-time performance of clusters on the Real-time Monitoring tab.
    Note For more information of metrics, click Metric Description.
    Real-time monitoring
    • You can click the Real-time Charts tab to view the real-time performance.

      Charts refresh every five seconds and display performance trends as line graphs. You can view the Available Refreshes in the upper-right corner.

    • You can click the Real-time Tables tab to view the real-time performance displayed as a table.

      Tables display up to 999 rows of detailed metrics. A row of real-time metric values is added to the table every five seconds.