tencent cloud

TencentDB for DBbrain

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Features
Strengths
Use Cases
Feature List
Region List
Purchase Guide
Operation Guide
Cloud Access Management
Self-Built Database Access
Instance Overview
Instance Management
Monitoring and Alarms
Health Report and Kill Session Report Management
MySQL/TDSQL-C for MySQL Performance Optimization
TDSQL for MySQL/MariaDB Performance Optimization
Distributed cache database (Distributed Cache) diagnostic optimization
MongoDB Performance Optimization
Full-Link Analysis
Practical Tutorial
Fixing High CPU Utilization on MySQL Instance
Fixing Lock Conflict on MySQL Instance
How to Address High CPU Utilization Issues in Distributed Cache Instances
Fixing High CPU Utilization in MongoDB Instance
Fixing Short Node Oplog Retention Period in MongoDB Instance
API Documentation
History
Introduction
Introduction
API Category
Making API Requests
Session Killing APIs
Exception Detection APIs
Other APIs
Redis related APIs
Health Report Email Sending APIs
Space Analysis APIs
Slow Log Analysis APIs
Security Audit APIs
Database Audit APIs
Data Types
Error Codes
DBbrain APIs 2019-10-16
FAQs
Self-Built Database Issues
MySQL Performance
Product
Service Level Agreement
Glossary
Contact Us

SQL Throttling

PDF
Focus Mode
Font Size
Last updated: 2025-07-29 16:33:46

Feature description

The SQL throttling feature is suitable for scenarios involving high CPU utilization caused by high traffic. You can create SQL throttling tasks to control the database requests and SQL concurrency by setting the SQL Type, Max Concurrency, Throttling Duration, and SQL Keyword.
Note:
SQL throttling is supported only for TencentDB for MongoDB 4.0 and 7.0 versions.
If SQL throttling prevents a SQL statement from being executed, the error message SQL rejected by CDB_SQL_FILTER will be displayed.

Creating SQL Traffic Throttling

1. Log in to the DBbrain Console.
2. In the left sidebar, choose Performance Optimization.
3. Select MongoDB database type and instance ID at the top of the page, and select the Real-Time Sessions tab.
4. At the bottom of the page, you can select the SQL Throttling module.

5. Create traffic throttling tasks.
Note:
SQL traffic throttling requires database account authentication and authorization.
5.1 Click Log In, enter the database account and password, and click OK.

5.2 On the page, click Create Task, configure the following parameters, and click OK.

SQL Type: Select find, insert, update, or delete.
Max Concurrency: Set the maximum number of concurrent SQL executions. If the number of concurrent SQL executions containing specified keywords reaches this value, the SQL throttling policy will be triggered. If this value is set to 0, it restricts all matched SQL executions.
Execution Mode: Select Scheduled stop or Manual stop.
Throttling Duration: If you select Scheduled stop, you need to set how long the SQL throttling task runs.
SQL Keyword: Set the keywords. SQL statements containing the specified keywords will be restricted. Multiple keywords should be separated by comma and are evaluated by using the logical AND operator. Comma cannot be used as a keyword.
6. View the status and details of the SQL throttling task.
Click Details in the Operation column to view SQL throttling details.
After a SQL throttling task is enabled, it will remain in the Running status until its remaining time decreases to zero. You can click Disable in the Operation column to disable the task, and its status will change to Terminated.
After a SQL throttling task is enabled, its status will change to Terminated once its remaining time decreases to zero.
Click Delete in the Operation column to delete a SQL throttling task in the Terminated or Completed status.

Use case and effect of SQL throttling

The database traffic was too high, resulting in a high CPU utilization.
1. The MongoTop tab in the console shows that the traffic of the test.test11 table was too high. If the main business traffic was the read traffic to the test.test10 table, then the traffic to the test.test11 table was abnormal traffic.


2. SQL throttling was enabled to throttle the traffic to the test.test11 table.
3. As shown in the CPU performance trend chart below, CPU utilization dropped rapidly after throttling was enabled.



Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback