DBbrain provides a killing session feature, which supports killing current sessions, killing sessions during a period, and viewing the history of killed sessions, facilitating session management for users.
Feature Description
Kill current sessions: It can kill the currently executing session.
Kill sessions during a period: It supports creating, viewing, stopping, and deleting tasks for killing sessions during a period. You can create a task for killing sessions, with task types including Conditional Kill and One-Click Kill. When conditions are met, the kill session operation is automatically triggered.
View the history of killed sessions: It supports viewing the history of killed current sessions and tasks for killing sessions during a period.
Operations
Killing Current Sessions
2. In the left sidebar, choose Diagnosis and Optimization.
3. At the top of the page, select the database type and instance ID, and select the Real-Time Session tab.
4. On the Real-Time Session page, select the Active Session tab.
5. In the session list, check the session to be killed, click Kill Session at the top right of the list, and click OK in the pop-up dialog box.
After killing the session, you can click Kill records at the top of the list to view the killed sessions.
Killing Sessions During a Period
Creating Tasks for Killing Sessions During a Period
1. On the Real-Time Session page, select the Active Session tab.
2. Click Kill Sessions During a Period at the top right of the list.
3. Set the parameters for tasks for killing sessions during a period in the pop-up dialog box.
Task types include Conditional Kill Task and One-Click Kill. The parameters configured vary depending on the selected task type.
Conditional kill task
Note:
Conditional kill templates are only applicable to the same instance.
You can enter one or more conditions. The conditions are in an AND relationship. After the conditions are set, all sessions that meet the conditions can be terminated except the system connections.
If only Time and Duration are filled in, all sessions that meet the conditions will be killed with one click. Operate with caution.
Up to 5 conditional kill tasks can run simultaneously.
3.1.1 Select the Conditional Kill type.
3.1.2 Select the execution method: If you select Scheduled Stop, you should select the duration for tasks for killing sessions during a period. The task will automatically close after the duration ends. If you select Manual stop, after the task is successfully created, you can manually close the task in the operation column of the Kill Task List.
3.1.3 Select a template:
Do not select a template: You can directly set the kill session conditions (USER, HOST, DB, COMMAND, INFO, TIME). If you need to save the set conditions as a template for future use, click Save as Template at the bottom of the page, enter the template name, and then click OK and Next.
Directly reuse template settings: After you select a template, no further operation is required, you can directly click Next.
Modify an existing template and save the changes: You can select the template, modify the conditions, click Save Changes, enter the template name, and then click OK and Next.
Delete selected templates: After you select the template, you can click Delete and OK. Once deleted, the template cannot be recovered.
Modify conditions based on the selected template and save as a new template: You can select the template, modify the conditions, and then click Save as Template at the bottom of the page. Enter the template name, and then click OK and Next.
One-click kill task
Note:
For one-click kill, it will end all sessions within the task duration. You should use this feature with caution.
3.1.4 Select the One-Click Kill type.
3.1.5 Select the execution method. If you select Scheduled Closure, you should select the duration for tasks for killing sessions during a period. The task will automatically close after the duration ends. If you select Manual Closure, after the task is successfully created, you can manually close the task in the operations column of the Kill Task List.
3.1.6 Check I have read the risk prompts and agree to use this feature.
4. Click Next to enter the Session Preview page to preview the sessions to be killed.
If there are no sessions that meet the conditions, the Session Preview page will display no data.
5. Click OK, the top right of the Session Kill Task List will show Running, and the top of the list will show Killing Sessions During a Period.
6. Click Session Kill Task List
to copy, view, stop, and delete the created tasks for killing sessions during a period. The list parameter description is shown in the following table:
|
Type | It includes Conditional Kill, One-Click Kill, and Autonomous Center. The autonomous center triggers an abnormal SQL kill task after configuring the autonomy service on the Autonomous Center page. For detailed instructions and operations, see Autonomy Service. |
Status | It includes Create, Run, Complete, and Terminate. Create: The task is being created. Run: The task is in progress. Complete: The task with the execution method set to Automatic Closure will be automatically closed after the specified task duration ends. Terminate: There are two situations. The task with the execution method set to Automatic Closure will be manually closed before the specified task duration ends. The task with the execution method set to Manual Closure will be manually closed. |
Keyword | The advanced kill configuration will be set only when the task type is an autonomous center and the autonomy service is configured. For detailed instructions and operations, see Autonomy Service. |
Operator | ID of the account used to create a kill task. |
Start time | Start execution time of the task. |
Remaining Time | Remaining time of the ongoing task. When a task is created, the task execution time is Automatic Closure: When the status is Run and the task type is Autonomous Center, Remaining Time = Traffic Throttling Duration (set when creating the task) - Start Time (displayed in the task list). When the status is Run and the task type is One-Click Kill or Conditional Kill, Remaining Time = Duration (set when creating the task) - Start Time (displayed in the task list). When the status is Complete or Terminate, the remaining time is 0. When a task is created, the task execution time is Manual Closure: The remaining time displays --. |
Operation | Copy task configuration: Click Copy in the Operation column to copy the configuration information of the corresponding tasks for killing sessions during a period. View task details: Click Details in the Operation column. Stop task: When you need to terminate a task with the status Run, click Stop in the Operation column. Delete task: When you need to delete a task with the status Terminate or Complete, click Delete in the Operation column. |
Viewing the History of Killed Sessions
1. Go to the Active Sessions page.
2. Click Kill records at the top right of the list, select a time period (including the last 1 hour, last 24 hours, last 7 days, last 30 days, or a custom time period), and view the history of killed sessions.
Related Operations