Updated on 2024-11-06 GMT+08:00

Configuring Auto Flow Control

Auto flow control allows you to kill all sessions, kill specific sessions by criteria, and view history.

To kill the current session or manually kill a session, see Managing Real-Time Sessions.

Functions

  • Killing all sessions: After you enable Auto Kill Sessions and click Kill All Sessions, all sessions are automatically deleted.
  • Killing specific sessions by criteria: You can add a task for killing sessions. Sessions that meet the criteria will be killed.
  • Viewing history: You can view killed sessions.

Killing Specific Sessions by Criteria

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner of the page and choose Databases > GaussDB(for MySQL).
  4. On the Instances page, click the instance name.
  5. In the navigation pane, choose DBA Assistant > Historical Diagnosis.
  6. Click SQL Explorer and then Auto Flow Control.
  7. Click on the right of Auto Kill Sessions. In the displayed dialog box, click OK.

    Figure 1 Enabling Auto Kill Sessions

  8. Click Add Kill Task.

    Figure 2 Adding a task for killing sessions

  9. In the displayed dialog box, set the criteria for killing sessions.

    Figure 3 Setting the criteria for killing sessions

    • The parameters listed in Table 1 are in a logical AND relationship.
    • If you only specify Session Duration (s) and Task Duration (s), all sessions that meet the criteria will be killed.
    • A maximum of five conditional kill tasks can be executed at the same time.
    Table 1 Parameter description

    Parameter

    Description

    User

    Enter a single value, for example, root.

    Host IP Address

    Enter a single value, for example, 168.192.0.0.

    Database Name

    Enter a database name.

    Command

    Enter a command.

    SQL Statement

    Enter an SQL statement.

    Session Duration (s)

    The value ranges from 1 to 2147483647.

    Task Closure Method

    If you select Scheduled, you need to set Task Duration. After the duration ends, the task is automatically closed.

    If you select Manual, you can click Stop in the Operation column of the task list to manually close a task.

    Task Duration (s)

    The value ranges from 10 to 31535999.

  10. Click OK.

    When the criteria for killing sessions are met, the system automatically kills the sessions.

Killing All Sessions

  1. On the Instances page, click the instance name.
  2. In the navigation pane, choose DBA Assistant > Historical Diagnosis.
  3. Click SQL Explorer and then Auto Flow Control.
  4. Click on the right of Auto Kill Sessions. In the displayed dialog box, click OK.

    Figure 4 Auto Kill Sessions

  5. Click Kill All Sessions.

    Figure 5 Killing all sessions

  6. In the displayed dialog box, click OK.

Viewing History

  1. On the Instances page, click the instance name.
  2. In the navigation pane, choose DBA Assistant > Historical Diagnosis.
  3. Click SQL Explorer and then Auto Flow Control.
  4. Click on the right of Auto Kill Sessions. In the displayed dialog box, click OK.

    Figure 6 Auto Kill Sessions

  5. Click View History.

    Figure 7 Viewing killed sessions

  6. In the displayed dialog box, select a time range to view killed sessions within that period.

    Figure 8 Viewing killed sessions

    A maximum of 500 session records can be displayed.