Updated on 2024-04-03 GMT+08:00

Setting a Slow Session Threshold

You can set a slow session threshold to identify sessions whose execution time is longer than the threshold. This allows you to identify abnormal sessions and kill the sessions to restore the database.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  4. On the Instances page, click the DB instance name.
  5. In the navigation pane, choose DBA Assistant > Real-Time Diagnosis.
  6. Click the Sessions tab.
  7. Click Set Slow Session Threshold and specify Max. Execution Time for a Query (s).

    Max. Execution Time for a Query (s) indicates how long a session has been executed before it can be considered as a slow session. The default value is 3. The value ranges from 1 to 86,400, in seconds.

    Figure 1 Setting a slow session threshold

  8. Click OK. Sessions whose execution time exceeds the threshold are automatically displayed.
  9. In the Sessions area, select the target session IDs based on the instance status and service requirements, and click Kill Session.

    Figure 2 Viewing the session list

    The Kill Session operation ends only the selected sessions. It does not affect other sessions or services.

  10. Click OK.