Help Center> Document Database Service> User Guide> Connection Management> Querying DB Instance Connections and Managing Sessions
Updated on 2023-12-13 GMT+08:00

Querying DB Instance Connections and Managing Sessions

Scenario

  • You can query the number of internal and external connections of a DB instance and the source IP addresses of these connections.
  • You can also manage the sessions of an instance node and kill an abnormal session that takes a long time.

Precautions

  • This function is not available to ECS-hosted instances and instances in the creating, frozen, or abnormal state.
  • Exercise caution when killing a session. Your operations will be recorded in logs.
  • This function is available for replica set instances and cluster instances of versions 3.4, 4.0, 4.2, and 4.4.
  • When the CPU usage reaches the upper limit, requests to kill sessions may time out. In this case, you have to try more than once.

Querying the Number of Connections of a DB Instance

  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 > Document Database Service.
  4. In the navigation pane on the left, choose Data Admin Service.

    Figure 1 Data Admin Service

  5. In the navigation pane on the left, choose DDS Instance Connections and Sessions.
  6. In the Current Instance area in the upper part of the page, click Select Instance to select the required DDS DB instance.
  7. Click the Connections page to view the number of internal and external connections of the current DB instance and the source IP addresses of these connections.

    Figure 2 Connections

  8. On the displayed page, click Change Node to view the number of internal and external connections of a specified node in the DB instance and the source IP addresses of these connections.

Managing Sessions

  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 > Document Database Service.
  4. In the navigation pane on the left, choose Data Admin Service.

    Figure 3 Data Admin Service

  5. In the navigation pane on the left, choose DDS Instance Connections and Sessions.
  6. In the Current Instance area in the upper part of the page, click Select Instance to select the required DDS DB instance.
  7. Click the Sessions page to view the sessions of the current instance node.

    Figure 4 Sessions
    In the statistical item list, you can view total sessions, running sessions, and longest running session time of the current instance node. You can also view total sessions and active sessions by host or namespace. In the session list, you can view session details and perform the following operations:
    • Select the abnormal session you want to end and click Kill for your database to recover.

    • Exercise caution when performing the kill operation. After you kill a session, you can switch to the History Logs tab to view the details.

    • Specify Sessions lasting longer than and click the refresh button to search for the sessions who last longer than this threshold.