Session throttling lets you set concurrency limits for find, insert, update, and delete operations on specified collections. This helps you control request volume to ensure the availability and stability of your database service.
Prerequisites
Ensure that your instance meets the following version requirements:
Major version 5.0: Minor version 6.0.13 or later
Major version 6.0: Minor version 7.0.9 or later
Major version 7.0: Minor version 8.0.4 or later
Major version 8.0: No minor version restrictions
Procedure
Go to the ApsaraDB for MongoDB replica set instances or ApsaraDB for MongoDB sharded cluster instances page, select a resource group and region at the top, and then click the target instance ID.
In the left-side navigation pane, click .
Click Session Throttling.
On the Session Throttling page, click Create Throttling Rule.
In the dialog box that appears, configure the parameters for the throttling rule.
Parameter
Description
Operation type
Select the operation types to throttle. You can select multiple types. Valid values:
find,insert,update, anddelete.Operation concurrency
Specify the maximum number of concurrent operations allowed for the selected operation types. Requests that exceed this threshold are throttled.
Throttling duration
Set the active duration for the throttling rule. After the rule expires, the system automatically disables it and moves it to the Ended tab.
Kill Statement
(Optional) If you enable this option, when the throttling rule takes effect, the system automatically terminates (kills) any active operations that match the rule, such as long-running
findorupdateoperations. The system performs this action only once to immediately release occupied connections and computing resources. New requests that arrive after the rule is active are throttled and are not terminated. This feature is ideal for emergency situations where a sudden workload surge has caused a large number of long-running transactions to accumulate, requiring an immediate release of resources.Throttling scope
This option is available only for ApsaraDB for MongoDB sharded cluster instances. You can apply the rule to All Shards or Partial Shards.
Throttled collections
Specify the collections that the rule applies to. Use the
databaseName.collectionNameformat.After you confirm the configuration, click Submit.
After the rule is created:
On the Session Throttling page, you can view, modify, or disable the throttling rule on the Running tab.
On the Session Throttling page, you can view or re-enable an expired throttling rule on the Ended tab.