Updated on 2025-12-08 GMT+08:00

SQL Throttling

To ensure stability of core services, DAS throttles SQL statements based on specified rules when they cannot be tuned in a timely manner or when resource (for example, CPU) usage reaches 100%.

Usage Notes

  • SQL throttling is only available to RDS for MariaDB 10.5.16.230600 or later.
  • The new SQL throttling rule is only available to the current DB instance.
  • If a SQL statement matches multiple SQL throttling rules, only the latest rule is applied.
  • SQL statements executed before a SQL throttling rule is added will not be counted.
  • Keywords of a throttling rule are sorted in a specific order, and the system will match them from first to last. For example, if one rule contains the keyword a~and~b, the system only matches xxx a>1 and b>2.
  • If the replication delay is too long, adding or deleting a SQL throttling rule for a read replica instance does not take effect immediately.
  • Empty characters before and after each keyword will be ignored, for example, spaces, \n, \r, and \t.
  • SQL throttling is invalid for:
    • System tables
    • SQL statements not used to query data, for example, SELECT SLEEP(xxx)
    • Account root
    • SQL statements in stored procedures, triggers, and functions

Procedure

  1. Log in to the console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner, and under Databases, click Data Admin Service.
  4. In the navigation pane, choose Intelligent O&M > Instance List.

    Alternatively, on the Overview page, click Go to Intelligent O&M.

  5. In the upper right corner of the Instance List page, search for instances by engine type, instance name, or instance IP.
  6. Locate the target instance and click Details. The Dashboard page is displayed.
  7. Click the SQL tab and then SQL Throttling.
  8. On the displayed page, toggle on Enable SQL Throttling.

    Figure 1 Enabling SQL throttling

  9. Click Add Rule. In the displayed dialog box, specify SQL Type, Keyword, and Max. Concurrent Requests.

    Figure 2 Add Rule
    Table 1 Parameters

    Parameter

    Description

    SQL Type

    The options are SELECT, UPDATE, and DELETE.

    Keyword

    A maximum of 128 case-insensitive keywords are supported. You can specify keywords in either of the following ways:

    • Enter keywords. Take select~a as an example. select and a are two keywords contained in a SQL throttling rule. The keywords are separated by a tilde (~). In this example, the rule restricts only SQL statements containing keywords select and a.
    • Generate keywords from a SQL statement. You can enter a SQL statement to the text box and click Generate Keyword. Keywords generated from an original SQL statement are only for reference.

    Max. Concurrent Requests

    If the number of concurrent SQL statements matching the keyword exceeds this limit, the SQL statements will not be executed.

    Kill existing sessions that match this rule

    If this option is selected, the connection sessions of user root will not be killed.

  10. Confirm the settings and click OK.

    If a SQL throttling rule is no longer needed, click Delete in the Operation column.