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
This topic describes how to use the session management feature of Database Workshop (DBW) to view session statistics and real-time session information of an instance by RDS for MySQL engine or RDS for MySQL proxy.​
Prerequisites​
tip​
This feature is not supported when the instance status is creating, recovering, importing, error, deleted, terminated, waiting for payment, billing suspension in progress, billing restoring, billing reclaiming or reconstructing.​
Precautions​
  • When the database proxy is enabled for an RDS for MySQL instance, session information for both RDS for MySQL engine and RDS for MySQL proxy is supported. While the proxy feature is disabled, only session information for RDS for MySQL engine is available. The proxy feature is enabled by default. If you do not need to view proxy sessions, you can disable the proxy for RDS for MySQL instances. For specific steps, refer to Enabling database proxy.​
  • The session statistics refresh interval is set to 5 seconds by default. You can choose to disable auto-refresh or change the interval to 10 or 15 seconds.​
  • The Real-time session tab does not display connections from internal accounts of RDS for MySQL (e.g., root, repl, byte_rds_agent, byte_rds_backup, byte_rds_proxy) and DBW (e.g., dbw_admin).​
  • 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 Allowlist is named in the format of DBW_Sole___***_RDS Or byte_rds___***-.​
  • 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 newly created instances in DBW are disabled by default. If you need to enable session snapshots, you can do so in the instance list or in the session management and transaction and lock sections of the instance. Session snapshots are enabled for existing instances.​
  • 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 Observation and diagnosis page, above the Session managementtab, switch the instance.​
tip​
  • You can also switch to the target instance by searching for the instance ID.​
  • When you access the Session management tab through Operation observability on the left navigation bar, information about the first instance in the Instance list is viewed by default.​
  1. On the Session management tab, click RDS for MySQL engine or RDS for MySQL proxy to view session statistics and real-time session information as follows:​
  • ​
    RDS for MySQL engine
    RDS for MySQL proxy
    ​
    On the RDS for MySQL engine pane, you can view the following information:​
    • In the session statistics area, view session statistics, such as total number of sessions, active sessions, CPU usage, Top5 user statistics, Top10 IP source statistics, and TOP10 database.​
    • On the Aggregation session pane, perform the following:​
    tip​
    Aggregation sessions only count session information for active sessions.​
    • View the details of the aggregation session: You can review all aggregation sessions for the instance within a specified time range, with support for querying sessions up to the last 24 hours. The aggregation session information includes SQL template, Database name, Execution time, 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 information 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).​
    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.​
    • Filter sessions: Filter qualified instance 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​
  • Multiple persistent Kill session tasks are independent of each other (an "or" relationship) and do not interact.​
  • When RDS MySQL has the database proxy enabled and uses a transaction pooling connection mode, its connection reuse mechanism may lead to unexpected behavior during KILL sessions. If you attempt to KILL a current session, the connection might have already been reused by another session, causing the KILL operation to not execute as expected. The following two scenarios may occur:​
  • Failed to KILL a system connection: After enabling the database proxy, system connections may also reuse user session connections. In some cases, if the user connection you attempt to KILL is being reused by a system connection, you may receive an "insufficient permissions" error. This happens because system connections typically have higher privilege levels and can not be directly terminated by normal users.​
  • KILL connections from other users: Due to connection reuse, if user A’s session connection is reused by user B before the KILL operation is executed, attempting to KILL user A’s session may instead terminate user B’s connection.​
  • Additionally, during batch KILL operations, if an "insufficient permissions" error appears, it typically only indicates the failure to KILL system sessions. Other session KILL operations will continue to be executed normally.​
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. In the upper left corner of the Session management tab, switch the instance.​
  1. On the Session information sub-tab of Session management, click Engine.​
  1. On the Session information sub-tab, 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 newly created instances in DBW are disabled by default. If you need to enable session snapshots, you can do so in the instance list or in the session management and transaction and lock sections of the instance.​
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. On the Session management tab, click MySQL engine.​
  1. In the Aggregation session or Real-time session information tab area, click the switch for 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 session snapshots 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 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. On the Session management tab, click MySQL engine.​
  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.06.02 15:44:10