You need to enable JavaScript to run this app.
Database Workshop

Database Workshop

Copy page
Download PDF
Session management
Session management
Copy page
Download PDF
Session management
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​
  1. Log on to the DBW console.​
  1. On the top menu bar, select the project and region.​
  1. On the left navigation bar, select Operation and maintenance management > Observation and diagnosis.​
  1. On the upper-right corner of the Session management tab in the Observation and diagnosis page, switch the Instance type to veDB for MySQL.​
  1. 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.​
  1. 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​
  1. Log on to the DBW console.​
  1. On the left navigation bar, select Operation and maintenance management > Observation and diagnosis.​
  1. On the top menu bar, select the project and region.​
  1. On the Observation and diagnosis page, click Session management.​
  1. In the upper-right corner of the page, locate the drop-down list and select the target database type - veDB MySQL.​
  1. In the upper-right corner of the page, locate the drop-down list and select the target instance.​
  1. On the Session information sub-tab of Session management, click Real-time session.​
  1. On the Real-time session pane, select the KILL session mode as needed.​
  • ​
    KILL selected session
    KILL all sessions
    KILL matching sessions
    Persistent Kill
    ​
    1. Check the target session ID and click KILL selected session.​
    1. In Confirm KILL? dialog box, confirm the session information that needs to be killed, and click OK​
    ​
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:​
  • 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
​
  1. Log on to the DBW console.​
  1. On the top menu bar, select the project and region.​
  1. On the left navigation bar, select Operation and maintenance management > Observation and diagnosis.​
  1. 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.​
  1. 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.​
  1. On the Observation and diagnosis page, click Session management.​
  1. In the Aggregation session or Real-time session information tab area, click the switch of Session snapshot.​
  1. In the Snapshot settings dialog, you can enable or disable session snapshots and transaction and lock snapshots for the current instance.​
  • ​
    Parameter​
    Set​
    Session snapshot​
    Enable or disable the session snapshot as needed.​
    • Enable: Click Enable to enable session snapshot for the current instance.​
    • Disable: Click Disable to disable session snapshot for the current instance.​
    Collection backoff​
    ​
    Collection backoff is a self-protection mechanism that ensures instance performance and business stability.​
    Once enabled, if an instance anomaly causes collection failures or prolonged collections (where a single collection takes over 1 second), this strategy will automatically activate to gradually reduce the collection frequency, and progressively restore it to normal once the instance recovers. While delivering monitoring capabilities, it minimizes the performance impact on database instances. The values are as follows:​
    • Yes: Enables collection backoff. Collection backoff can only be enabled when session snapshot is enabled.​
    • No: Disables collection backoff.​
    ​
  1. Click OK.​
​
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.​
  1. Log on to the DBW console.​
  1. On the top menu bar, select the project and region.​
  1. On the left navigation bar, select Operation and maintenance management > Observation and diagnosis.​
  1. 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.​
  1. 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.​
  1. On the Observation and diagnosis page, click Session management.​
  1. In the Real-time session information tab area, click Session snapshot list.​
  • ​
    Export Session Details
    Export the current snapshot point
    ​
    1. On the Session snapshot list control panel, click Download Snapshot and select Export session details.​
    1. In the Export Session Details pop-up window, set the following parameters.​
    • ​
      Parameter​
      Description​
      File format​
      The supported file formats are CSV or JSON.​
      Export range​
      Select the Session snapshot Export range as needed. The current support Customize, Past 2 hours, Past 12 hours and Past 24 hours.​
      Custom time period​
      Select the time frame for exporting the session snapshot.​
      tip​
      This parameter can be set when Export range is set to Custom.​
      ​
    ​
    ​
  1. Click OK.​
  1. In the Export history dialog box, select the target task whose Status is Generated, and click Download file in the Actions column.​
Last updated: 2026.07.02 16:56:33