Database Workshop (DBW) provides session management to view session statistics and real-time session information of the primary and read-only nodes of instances. This topic describes the precautions and steps of session management.
Prerequisites
Precautions
- The Real-time session tab does not display the connections of internal accounts (such as root, repl, byte_rds_agent, byte_rds_backup, byte_rds_proxy) and DBW internal accounts (such as dbw_admin) for veDB for MySQL instances.
- When you access session management under operation observability, the IP address of the DBW backend service host is automatically added to the allowlist of the corresponding product. The allowlist naming format varies by instance type, The naming format of the allowlist is dbw_unique_****_**** or byte_ndb_****_***_*dbw.
- While using the session management feature, avoid modifying instance configurations, as this may prevent normal display of session information.
- Session snapshot files downloaded by the system are compressed in the .gz (Gzip) format. For macOS users, please extract the downloaded file using the steps below:
- Decompress using the built-in gzip or gunzip command-line tools:Open the Terminal and run the gzip or gunzip commands provided by the system to extract the files. The command format is gzip -d your_filename.gz or gunzip your_filename.gz.
- To decompress the file using the tar tool: Download and install the tar tool to decompress the file. The command format is tar -xz --force-local -f file_name.gz.
- Starting from 2025.12.05, session snapshots for all new instances are disabled by default. To enable session snapshots, you can enable them in the instance list or within session management, transaction and lock management of the instance. Session snapshots for existing instances are enabled.
- Enabling the snapshot feature will periodically collect instance-related information, which introduces additional overhead to the instance.
- The default collection frequency is 30 seconds.
- Collection tasks are executed serially; that is, a new collection will not start until the previous one has completed.
- After enabling or disabling the snapshot feature, the data collection tasks will be adjusted within a few minutes.
- After the snapshot feature is disabled, historical data is retained for up to 30 days.
- The aggregation session and hotspot analysis functions in session management both rely on session snapshot data. Therefore, to use the instance's aggregation session or hotspot analysis functions normally, enable session snapshots for the instance.
- Qwen3.7-MaxIf the backoff strategy is enabled for the instance, the system may skip certain collection points when high database load causes collection timeouts. In this case, you can refer to the last collection record prior to the skip for diagnosis.
View a session
- On the top menu bar, select the project and region.
- On the left navigation bar, select Operation and maintenance management > Observation and diagnosis.
- On the upper-right corner of the Session management tab in the Observation and diagnosis page, switch the Instance type to veDB for MySQL.
- Switch the target instance in the upper-left corner of the Session management tab on the Session information page.
- When you access session management via Operation observability on the left navigation bar, the session information of the first instance in the instance list is displayed by default. You can also access the Session management tab for a specific instance by clicking Operation observability in the Actions column on the Instance list page.
- On the Session information tab of the target instance. Click the Node ID drop-down list to select the primary node or read-only node to view session statistics and real-time session information, as follows:
tip
Session statistics are refreshed every 5 seconds by default, and you can also turn off or modify the interval time.
- On the Session statistics pane, view session statistics such as Total sessions, Active sessions, CPU usage, TOP5 user statistics, TOP5 IP source statistics and TOP5 database.
- On the Aggregation session pane, perform the following:
- View detailed information about aggregated sessions: You can view all aggregated session information for an instance within a specific time range. The maximum query time is 24 hours, and the aggregated session information includes SQL template, Database name, Execution times, Average execution time(s), Maximum execution time(s), and Total execution time(s). You can also click the target SQL template under the SQL template column to view session details.
- Filter sessions: Enter session keywords in the Search keywords, such as SELECT text box, to query eligible session information.
- View session hotspot analysis: Hotspot analysis provides in-depth insights into user interactions and high-traffic areas, helping optimize system performance and enhance user experience. Click hotspot analysis to access its control panel, where you can view TOP 5 hotspot analysis results, including SQL text, execution time, and execution rate. You can also click Rate limit in the Actions column for a target SQL to control database request volume and SQL concurrency, ensuring service availability. For details on SQL throttling configuration, refer to SQL throttling management.
- On the Real-time session pane, perform the following:
- View session details: You can view each session's information including Progress ID, User name, Host, Database name, Command type, Duration, Status, Execute statement, Blocking process ID, Node type and Node ID, where the duration is the duration of the current state.
- View session snapshots: Click Session snapshot list to access the Session snapshot list control panel. Select the desired instance node and time range (query span must not exceed 24 hours). View session details and engine information of the snapshot point. The session snapshot list displays session information only for the target node ID (e.g., primary node or read-only node).
tip
Session snapshots are retained for up to 30 days and can be viewed in the list.
- Terminate sessions: You can terminate sessions as needed. For detailed steps, refer to KILL sessions.
tip
When you terminate the target session, sessions with the same session ID in all nodes will be deleted and can not be recovered after deletion. Exercise caution when performing this operation.
- Filter sessions: Filter qualified all sessions as needed based on Active sessions or All sessions from the Session type drop-down list.
- Create a persistent Kill session task: Click Persistent Kill to create a persistent Kill session task. For more information, refer to KILL sessions.
KILL session
DBW provides the kill session function, which can be used to terminate specific processes or sessions, maintaining system stability and efficiency. DBW offers methods including KILL selected sessions, KILL all sessions, KILL matching sessions, and persistent KILL sessions to help you effectively control system resources and process behavior.
Precautions
KILL sessions cannot be recovered and should be performed with caution.
Procedure
- On the left navigation bar, select Operation and maintenance management > Observation and diagnosis.
- On the top menu bar, select the project and region.
- On the Observation and diagnosis page, click Session management.
- In the upper-right corner of the page, locate the drop-down list and select the target database type - veDB MySQL.
- In the upper-right corner of the page, locate the drop-down list and select the target instance.
- On the Session information sub-tab of Session management, click Real-time session.
- On the Real-time session pane, select the KILL session mode as needed.
KILL selected session
KILL all sessions
KILL matching sessions
Persistent Kill
- Check the target session ID and click KILL selected session.
- In Confirm KILL? dialog box, confirm the session information that needs to be killed, and click OK
- Click KILL all sessions.
- In Confirm KILL? dialog box, confirm the session information that needs to be killed, and click OK
- Click KILL matching sessions.
- In the KILL matching sessions dialog box, configure the following parameters.
- IP address: Enter IP addresses as needed. Up to 10 IP addresses are supported, separated by commas (,).
- Username: Enter username as needed. Up to 10 usernames are supported, separated by commas (,).
- Database name: Enter database name as needed. Up to 10 database names are supported, separated by commas (,).
- Additional KILL conditions: You can select SQL type, SQL template, and Null KILL additional conditions.
- SQL type: When you select SQL type in Additional KILL conditions, you can select the SQL additional conditions for KILL session as needed, including SELECT, UPDATE, DELETE, INSERT, and REPLACE options.
- SQL template: When you select SQL template in Additional KILL conditions, enter the relevant information as needed in the Enter SQL text as sample area of the SQL template, and click Generate SQL templates.
- In Confirm Kill? Confirm the session information to be killed in the pop-up window.
- In the Persistent Kill session dialog box, configure the following parameters:
- SQL type: Check the SQL statement types that need to be continuously killed as required, including SELECT, UPDATE, DELETE, and INSERT.
- Node Type: Check the node types to be persistently killed as needed, including Primary node and Read-only node.
- SQL execution time: Set the time to execute the Kill session when the SQL statement execution time exceeds the specified time limit as required. The default value is 1, with a valid range of 1~9,999 seconds (s).
- Task duration: Set the duration for which the persistent Kill task will remain active. The task will automatically stop once the specified duration is reached. The default value is 1, with a valid range of 1~99,999,999. You can also manually stop the persistent Kill session task.
Related operation
After successfully creating a persistent Kill task, you can perform the following operations in the Kill task list:
- View Kill tasks: In the Kill task list dialog box, view the Task ID, Task status, SQL type, Node type, SQL execution time, Creator, Start Time, remaining effective time (s), and other information of the target task.
- Task status includes Running, Completed , Terminated , Deletion failed and Termination failed.
- Terminate a running task: In the Kill task list dialog box, click Terminate in the Actionscolumn of the target task.
- Delete a task that has Terminated or Completed: click Delete in the Actions column of the target task.
- To delete a task in the running status: Click ... in the Actions column of the target task. > Delete.
Enable/disable session snapshot
Starting from 2025.12.05, session snapshots for all new instances are disabled by default. To enable session snapshots, you can enable them in the instance list or within session management, transaction and lock management of the instance. Session snapshots for existing instances are enabled.
tip
- Enabling the snapshot feature will periodically collect instance-related information, which introduces additional overhead to the instance.
- The default collection frequency is 30 seconds.
- Collection tasks are executed serially; that is, a new collection will not start until the previous one has completed.
- After enabling or disabling the snapshot feature, the data collection tasks will be adjusted within a few minutes.
- After the snapshot feature is disabled, historical data is retained for up to 30 days.
- The aggregation session and hotspot analysis functions in session management both rely on session snapshot data. Therefore, to use the instance's aggregation session or hotspot analysis functions normally, enable session snapshots for the instance.
- Qwen3.7-MaxIf the backoff strategy is enabled for the instance, the system may skip certain collection points when high database load causes collection timeouts. In this case, you can refer to the last collection record prior to the skip for diagnosis.
The methods to enable or disable session snapshots are as follows.
Set in Session management
Set in Instance list
- On the top menu bar, select the project and region.
- On the left navigation bar, select Operation and maintenance management > Observation and diagnosis.
- On the top menu bar in the upper-right corner of the Observation and diagnosis page, switch the database type.
- Switch the database type to RDS for MySQL.
- In the upper-left corner of the Observation and diagnosis page, click the drop-down icon to select the target instance.
tip
You can also switch to the target instance by searching for the instance ID.
- On the Observation and diagnosis page, click Session management.
- In the Aggregation session or Real-time session information tab area, click the switch of Session snapshot.
- In the Snapshot settings dialog, you can enable or disable session snapshots and transaction and lock snapshots for the current instance.
- On the top menu bar, select the project and region.
- On the left navigation bar, click Instance list.
- On the Instance list page, click the pencil icon under the Snapshot collection column of the target instance.
- In the Snapshot settings dialog box, you can enable or disable session snapshot and transaction and lock snapshots for the current instance.
Download session snapshot
tip
- In the export history pop-up window, you can view historical export tasks and download exported files.
- Download files are retained for 1 day. After they are expired, the download link will automatically become invalid. Save the files to your local computer in time.
- When exporting snapshot information, a maximum of 10,000 pieces of data can be exported at a time.
- Session snapshot files downloaded by the system are compressed in the .gz (Gzip) format. For macOS users, please extract the downloaded file using the steps below:
- Decompress using the built-in gzip or gunzip command-line tools:Open the Terminal and run the gzip or gunzip commands provided by the system to extract the files. The command format is gzip -d your_filename.gz or gunzip your_filename.gz.
- To decompress the file using the tar tool: Download and install the tar tool to decompress the file. The command format is tar -xz --force-local -f file_name.gz.
- On the top menu bar, select the project and region.
- On the left navigation bar, select Operation and maintenance management > Observation and diagnosis.
- On the top menu bar in the upper right corner of the Observation and diagnosis page, switch the database type.
- Switch the database type to veDB for MySQL.
- In the upper-left corner of the Observation and diagnosis page, click the drop-down icon to select the target instance.
tip
You can also switch to the target instance by searching for the instance ID.
- On the Observation and diagnosis page, click Session management.
- In the Real-time session information tab area, click Session snapshot list.
Export Session Details
Export the current snapshot point
- On the Session snapshot list control panel, click Download Snapshot and select Export session details.
- In the Export Session Details pop-up window, set the following parameters.
- In the Session snapshot list control panel, select the snapshot time point.
- In the Session information area, click the download icon.
- You can filter target session information by session type, Process ID, User name, Host, Database name, Command type, Duration, State, or Execute statement.
- In the Export the current snapshot point pop-up window, select the file format.
- The supported file formats are csv or json.
- In the Export history dialog box, select the target task whose Status is Generated, and click Download file in the Actions column.