Sessions
You can query, sort, and filter database session snapshots. You can quickly search for slow or active sessions in multiple dimensions like users, host IP addresses, and database names. DAS allows you to kill sessions to restore your instance, securing your database availability.
Usage Notes
Killing a session may cause instance or service exceptions.
Procedure
- Log in to the DAS console.
- Click
in the upper left corner and select a region and project. - In the navigation pane, choose Intelligent O&M > Instance List.
Alternatively, on the Overview page, click Go to Intelligent O&M.
- In the upper right corner of the Instance List page, search for instances by engine type, instance name, or instance IP.
- Locate the target instance and click Details. The Dashboard page is displayed.
- On the Sessions tab page, perform the following operations:
- View session statistics.
In the session statistics area, you can view statistics on slow sessions, active sessions, total sessions, and long transaction sessions by user, access host, and database.
Statistics can be collected by host and port or by host.
Figure 1 Sessions
- Set a slow session threshold.
- Kill abnormal sessions if necessary.
In the session list, you can view session details. You can also select the abnormal sessions you want to terminate based on session status and workload requirements and click Kill Session to recover the database.
Figure 3 Killing sessions
- Kill top 3 session groups.
With the Kill Top 3 function, the system will terminate sessions according to the rules below to recover the database. This may accidentally terminate unintended sessions, so proceed with caution.
The system retrieves the 1,000 sessions with the longest execution durations and retains only those running SELECT statements. It extracts keywords from each session and groups sessions with identical keywords. Sessions are terminated based on the following criteria:
- top3_time: The top 3 session groups with the longest execution duration will be killed.
- top3_count: The top 3 session groups with the largest session count will be killed.
- top3_avg_time: The top 3 session groups with the longest average execution duration will be killed.
- All sessions in a group will be killed at the same time. If a session matches multiple criteria, it will only be killed once.
You can turn on the Enable SQL Throttling and Add Rule toggle to make the system add throttling rules based on the session keywords meeting the above criteria. Generated rules are temporary and will be automatically deleted after a certain period of time. The system adds throttling rules targeting the top 3 groups with the longest average execution duration (Maximum number of concurrent SQL statements = Number of sessions × 0.3) and the top 3 groups with the largest number of sessions (Maximum number of concurrent SQL statements = Number of sessions × 0.5). If a throttling rule already exists for one of these groups, the system will skip this group and proceed to the next eligible group. A maximum of six rules can be generated at a time.
You can select Show killed sessions and Show SQL throttling rules to view the eligible sessions that are to be killed and the SQL throttling rules the system will add.
Figure 4 Killing top 3 session groups
- Create lock analysis.
In the session list, click Create Lock Analysis. A lock analysis record is generated, which is used to check for sessions that hold locks.
- Export the session list.
In the session list, click Export to export all or specified sessions.
- View the killing history of top 3 session groups. Figure 5 Viewing the killing history of top 3 session groups
Click the Killed Top 3 tab to view the history of Kill Top 3 operations. You can also download the instance-level operation history of the last three days.
- View session statistics.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
