All Products
Search
Document Center

ApsaraDB RDS:Automatic SQL throttling

Last Updated:Mar 30, 2026

Database Autonomy Service (DAS) automatically detects problematic SQL statements during traffic spikes and throttles them by keyword — without manual intervention. This protects your ApsaraDB RDS instance from performance degradation caused by sudden concurrency surges, unindexed queries, or abusive request patterns.

Supported versions

Automatic SQL throttling is available for ApsaraDB RDS instances running the following MySQL versions and editions:

MySQL version Supported editions
MySQL 8.0 RDS High-availability Edition, RDS Enterprise Edition
MySQL 5.7 RDS High-availability Edition, RDS Enterprise Edition
MySQL 5.6 RDS High-availability Edition

Use cases

Automatic SQL throttling is designed for the following scenarios:

  • Traffic spikes: Cache penetration or suspicious requests cause a sudden surge in concurrent SQL queries of a specific type.

  • Heavy single-user queries: A user submits a large number of SQL queries in a short period — for example, a shopper placing many orders simultaneously — consuming a disproportionate share of database resources.

  • Missing indexes: A large number of SQL statements without indexes are executed, degrading performance for other workloads.

Limitations

The throttling mode is Throttled by Keywords.

  • Supported SQL types: SELECT, UPDATE, DELETE, and INSERT

  • INSERT...SELECT... statements cannot be throttled

  • INSERT throttling is only supported on ApsaraDB RDS instances running MySQL 8.0 and PolarDB for MySQL clusters running MySQL 5.7 or 8.0

How it works

When automatic SQL throttling is triggered, the behavior depends on the MySQL version running on your ApsaraDB RDS instance.

MySQL 5.6 or MySQL 5.7

Throttled SQL statements are interrupted and the following error is returned to the client:

1317: "query execution was interrupted"

MySQL 8.0

Throttled SQL statements enter the Concurrency control waiting state. If the number of waiting statements exceeds the value of the ccl_max_waiting_count parameter, the following error is returned:

ERROR 7534 (HY000): "Concurrency control waiting count exceed max waiting count"

The ccl_max_waiting_count parameter controls how many throttled statements can wait before an error is returned:

ccl_max_waiting_count value Behavior
0 (default) All throttled statements wait indefinitely; no error is returned
0 when DAS enables throttling DAS automatically changes the value to 10
Any value > 0 DAS uses the specified value

Enable automatic SQL throttling

  1. Go to the Instances page. In the top navigation bar, select the region where your ApsaraDB RDS instance resides. Find the instance and click its ID.

  2. Open the Autonomous Function Management panel using either of the following paths:

    • In the left-side navigation pane, choose Autonomy Services > Diagnostics. Click the Autonomy Center tab, then click Autonomy Service Settings.

    • In the left-side navigation pane, choose Autonomy Services > Dashboard. On the Performance Trends tab, click Autonomy Service Settings.

  3. On the Autonomous Function Settings tab, enable the autonomy service. Click the Optimization and Throttling tab, select Automatic Throttling, and configure the throttling trigger conditions.

    When conditions are met within the configured time window, DAS begins monitoring the instance. If the issue persists after throttling starts, DAS automatically rolls back the throttling operation. Throttling duration never exceeds the Maximum Throttling Duration value.
    Parameter Description
    CPU Utilization > CPU usage threshold. Set to a value ≥ 70. For example, enter 80 to trigger throttling when CPU utilization exceeds 80%.
    Number of Active Sessions > Active session count threshold. Set to ≥ 16 when using an OR relationship with CPU Utilization, or ≥ 2 when using an AND relationship. For example, enter 64 to trigger throttling when active sessions exceed 64.
    Available Time Range The time window during which automatic SQL throttling is active.
    Maximum Throttling Duration The maximum duration of a single throttling event. If set to 0, throttling is triggered immediately but becomes invalid right away.
    Duration > How long the CPU and session conditions must persist before throttling triggers. For example, enter 2 minutes so that throttling activates only after the conditions hold for more than 2 minutes.

    2

  4. Click OK.

  5. (Optional) In the Alert Configuration section, configure an alert template and subscribe to notifications so you are informed when a throttling task starts or stops. The system recommends an alert template and pre-populates alert rules for the relevant autonomy events. Follow the on-screen prompts to complete the configuration.

    1. In the Select Alert Contact Group step, select an alert contact group. For more information, see Manage alert contacts.

      • Click Add Contact to add a new alert contact.

      • Click Create Contact Group to create a new alert contact group.

      • Click Edit or Remove to update or delete an existing contact.

    2. In the Associate with Resources step, confirm the associated resources.

    3. Click Submit Configuration and confirm in the dialog box that appears.

    If your ApsaraDB RDS instance already has an alert template, add the required alert rules to it as prompted. To create one from scratch, see Configure alert templates and Configure alert rules.

View throttling history

  1. Go to the Instances page. In the top navigation bar, select the region where your ApsaraDB RDS instance resides. Find the instance and click its ID.

  2. In the left-side navigation pane, choose Autonomy Services > Diagnostics.

  3. Click the Session Management tab.

  4. In the Instance Sessions section, click SQL Throttling. In the dialog box, view throttling tasks by status:

    Tab Description
    Running Throttling rules currently in effect. The task remains in this state until the Maximum Throttling Duration expires or until DAS automatically rolls back the operation.
    Complete Throttling tasks that have ended. Select a time range to filter history.

    SQL限流

    SQL限流

  5. If you selected Kill Abnormal SQL Statements in Execution when configuring throttling, click End Session History to view sessions that were terminated.

What's next

  • To optimize SQL statements and reduce resource consumption instead of throttling, see Automatic SQL optimization and SQL optimization.

  • If instance metrics do not reach the threshold needed to trigger automatic throttling, configure a manual throttling rule instead. See SQL throttling.

API reference

Operation Description
UpdateAutoThrottleRulesAsync Asynchronously configures automatic SQL throttling parameters for multiple database instances at a time
GetAutoThrottleRules Queries the automatic SQL throttling rules of database instances
DisableAutoThrottleRules Disables the automatic SQL throttling feature for multiple database instances at a time