Instance sessions allow you to view the information of sessions between an ApsaraDB for MongoDB instance and a client in real time, such as the client information, commands that are run, and connection duration. You can also terminate abnormal sessions based on your business requirements.
Prerequisites
The instance is a replica set instance or a sharded cluster instance that uses the MongoDB protocol.
Procedure
Go to the Replica Set Instances or Sharded Cluster Instances page. In the top navigation bar, select the region in which the instance resides. Then, find the instance and click the ID of the instance.
In the left-side navigation pane of the instance details page, choose .
On the Instance Sessions tab, select the node whose sessions you want to view from the Current Node drop-down list above the session list.
NoteIf you turn on Auto Refresh, the system updates session data every 5 seconds. By default, only active sessions are displayed. You can turn on Display All to view active and inactive sessions.
In the Session Statistics section, you can view the information of sessions in the Overview, Statistics by Client, and Statistics by Namespace tables.
Terminate instance sessions
To avoid an instance exception, we recommend that you do not terminate system-level sessions.
In the Instance Sessions section, select the sessions that you want to terminate, and click Kill Selected.
In the Terminate Session message, click Kill.