The Instance Sessions feature lets you view real-time client session data, terminate abnormal sessions, and create QPS throttling rules to improve system stability.
View or terminate sessions
Limitations
You cannot retrieve sessions created in direct connection mode for instances that use the cluster architecture.
Procedure
Log on to the console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click the instance ID.
-
In the navigation pane on the left, click .
-
You can view or terminate the Instance Sessions of the target instance and browse the Session Statistics.
-
View sessions
By default, the page displays detailed information for all sessions. You can hover over a column header to view its description.
NoteYou can enter a keyword in the search box to filter sessions. To refresh the session information, click Refresh in the upper-left corner or enable Auto Refresh.
-
Terminate sessions
Select a target session, or hold down the Shift key to select multiple sessions. Then, in the upper-right corner, click Kill Selected or Kill All.
WarningThis action forcibly disconnects the corresponding client. Proceed with caution.
-
View session statistics
The Session Statistics tab displays the total number of clients, the number of active clients, and the number of sources (client addresses).
NoteIn the statistics by source table, click the icon to the right of a client address to edit the source alias. In the Total column, click a number to view details about the connections from that source address.
-
Enable QPS throttling
After you enable QPS throttling, the system rejects requests that exceed the specified threshold and returns a THROTTLED error.
Usage notes
-
An active throttling rule is automatically disabled if the instance is restarted, undergoes an HA switchover, or is migrated.
Handle THROTTLED errors in your client application to prevent unexpected behavior. When your client receives a THROTTLED error, avoid frequent retries.
Prerequisites
This feature is available only for Tair (Enterprise Edition) DRAM-based instances that run in cloud-native mode and have a minor version of 25.12.2.0 or later.
Procedure
Log on to the console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click the instance ID.
-
In the navigation pane on the left, click .
-
On the right side of the page, click the QPS Throttling tab.
-
Click Create Throttling Rule and configure the rule parameters.
-
Throttling Mode: This parameter is fixed to Throttle by QPS.
-
Command: Select the type of traffic to throttle. Valid values are Read, Write, and All.
-
key: The key pattern to match. Both exact matches and wildcard patterns are supported. For example,
user*matches all keys that have theuserprefix. -
Username: (Optional) The user account to throttle. This corresponds to an account in Account Management.
-
Client IP: (Optional) The client IP address or CIDR block to throttle.
-
Minimum request size: The minimum request size, in bytes. Requests smaller than this value are not throttled.
-
Maximum QPS: The QPS limit. If the instance uses the cluster architecture or a read/write splitting architecture, this limit applies to each shard (node). The overall QPS limit for the instance is calculated by using the following formula: maximum QPS × number of shards (nodes).
-
Throttling Duration: The duration, in minutes, for which the rule is active. The rule is automatically removed upon expiration.
-
-
Click Submit.
The throttling rule is now active.
-
(Optional) You can modify the rule or disable it early.
Only one throttling rule can be active at a time. Creating a new rule overwrites the current one.
FAQ
-
Q: How do I disconnect a client?
A: In the console, go to . Select the target session and click Kill Selected.