- What's New
- Function Overview
- Product Bulletin
- Service Overview
- Billing
-
Getting Started
- Getting Started with RDS for MySQL
- Getting Started with RDS for MariaDB
- Getting Started with RDS for PostgreSQL
- Change History
- Kernels
-
User Guide
-
Working with RDS for MySQL
- Database Usage
- Database Migration
- Version Upgrade
-
Instance Management
- Instance Lifecycle
-
Instance Modifications
- Changing a DB Instance Name
- Changing a DB Instance Description
- Changing the Replication Mode
- Changing the Failover Priority
- Changing Read/Write Permissions
- Changing a DB Instance Class
- Scaling Up Storage Space
- Configuring Storage Autoscaling
- Changing the Maintenance Window
- Changing a DB Instance Type from Single to Primary/Standby
- Promoting a Read Replica to Primary
- Manually Switching Between Primary and Standby DB Instances
- Changing the AZ of a Standby DB Instance
- Data Backups
- Data Restorations
- Read Replicas
- Viewing and Changing a Floating IP Address
- Binding and Unbinding an EIP
- Changing a Database Port
- Applying for and Changing a Private Domain Name
- Configuring a Security Group Rule
-
Database Proxy (Read/Write Splitting)
- Introduction to RDS for MySQL Database Proxies
- Constraints on Database Proxy
- Using RDS for MySQL Database Proxies for Read/Write Splitting
-
Database Proxy Configurations
- Configuring Transaction Splitting
- Configuring Connection Pools
- Modifying Read/Write Splitting Parameters
- Configuring the Delay Threshold and Routing Policy
- Enabling or Disabling Access Control
- Changing the Read/Write Splitting Address
- Changing the Read/Write Splitting Port
- Changing the Number of Proxy Nodes
- Changing the Instance Class of a DB Proxy Instance
- Configuring Multi-Statement Processing Modes
- Changing a Proxy from Pay-per-Use to Yearly/Monthly
- Database Proxy Lifecycle
- Database Proxy Kernel Versions
- Best Practices for Database Proxy
- Problem Diagnosis and SQL Analysis
- Security and Encryption
-
Parameters
- Modifying Parameters of an RDS for MySQL Instance
-
Managing Parameter Templates
- Creating a Parameter Template
- Exporting a Parameter Template
- Comparing Parameter Templates
- Viewing Parameter Change History
- Replicating a Parameter Template
- Resetting a Parameter Template
- Applying a Parameter Template
- Viewing Application Records of a Parameter Template
- Modifying a Parameter Template Description
- Deleting a Parameter Template
- Suggestions on RDS for MySQL Parameter Tuning
- Log Management
- Metrics
- Interconnection with CTS
- Task Center
- RDS for MySQL Tags
-
Working with RDS for MariaDB
- Suggestions on Using RDS for MariaDB
- Instance Connection
- Parameter Tuning
- Instance Lifecycle
- Instance Modifications
- Read Replicas
- Data Backups
- Data Restorations
-
Parameter Templates
- Creating a Parameter Template
- Modifying RDS for MariaDB Instance Parameters
- Exporting a Parameter Template
- Importing a Parameter Template
- Comparing Parameter Templates
- Viewing Parameter Change History
- Replicating a Parameter Template
- Resetting a Parameter Template
- Applying a Parameter Template
- Viewing Application Records of a Parameter Template
- Modifying a Parameter Template Description
- Deleting a Parameter Template
- Connection Management
- Database Management
- Account Management (Non-Administrator)
- Account and Network Security
- Metrics
- Interconnection with CTS
- Log Management
- Task Center
- Managing Tags
-
Working with RDS for PostgreSQL
- Database Usage
- Database Migration
- Common Performance Problems
- Instance Lifecycle
-
Instance Modifications
- Upgrading a Minor Version
- Changing a DB Instance Name
- Changing a DB Instance Description
- Changing the Replication Mode
- Changing the Failover Priority
- Changing a DB Instance Class
- Scaling Storage Space
- Changing the Maintenance Window
- Changing a DB Instance Type from Single to Primary/Standby
- Manually Switching Between Primary and Standby DB Instances
- Changing the AZ of a Standby DB Instance
- Read Replicas
- Data Backups
- Data Restorations
-
Parameters
- Modifying Parameters of an RDS for PostgreSQL Instance
-
Managing Parameter Templates
- Creating a Parameter Template
- Exporting a Parameter Template
- Comparing Parameter Templates
- Viewing Parameter Change History
- Replicating a Parameter Template
- Resetting a Parameter Template
- Applying a Parameter Template
- Viewing Application Records of a Parameter Template
- Modifying a Parameter Template Description
- Deleting a Parameter Template
- Suggestions on RDS for PostgreSQL Parameter Tuning
- Connection Management
- Extension Management
- Tablespace Management
- Security and Encryption
- Metrics
- Interconnection with CTS
- Log Management
- Task Center
- Major Version Upgrade
- RDS for PostgreSQL Tags
-
Working with RDS for MySQL
- Best Practices
- Performance White Paper
-
API Reference
- Before You Start
- API Overview
- Calling APIs
- API v3.1 (Recommended)
-
API v3 (Recommended)
- Querying Version Information About APIs
- Querying Version Information About a DB Engine
- Querying Database Specifications
- Querying the Storage Type of a Database
-
DB Instance Management
- Creating a DB Instance
- Stopping an Instance
- Changing a DB Instance Name
- Changing the Description of a DB Instance
- Changing DB Instance Specifications
- Scaling Up Storage Space of a DB Instance
- Changing a Single DB Instance to Primary/Standby DB Instances
- Rebooting a DB Instance
- Deleting a DB Instance
- Querying DB Instances
- Binding and Unbinding an EIP
- Changing the Failover Priority
- Manually Switching Primary/Standby DB Instances
- Changing the Data Replication Mode of Primary/Standby DB Instances
- Configuring the Maintenance Window
- Database Security
- Backup and Restoration
- Log Information Queries
-
Database and Account Management (MySQL)
- Creating a Database
- Querying Details About a Database
- Querying Databases
- Querying Authorized Databases of a Specified User
- Deleting a Database
- Creating a Database Account
- Querying Database Users
- Querying Authorized Users of a Specified Database
- Deleting a Database Account
- Configuring a Password for a Database Account
- Authorizing a Database Account
- Revoking Permissions of a Database Account
- Resetting the Password for User root
- Database and Account Management (PostgreSQL)
-
Parameter Management
- Obtaining a Parameter Template List
- Creating a Parameter Template
- Modifying a Parameter Template
- Applying a Parameter Template
- Modifying Parameters of a Specified DB Instance
- Obtaining the Parameter Template of a Specified DB Instance
- Obtaining Parameters in a Specified Parameter Template
- Deleting a Parameter Template
- Recycling a DB Instance
- Tag Management
- Obtaining Task Information
- Appendix
- Change History
- SDK Reference
-
FAQs
- Product Consulting
- Resource and Disk Management
-
Database Connection
- What Should I Do If I Can't Connect to My RDS DB Instance?
- Can an External Server Access the RDS Database?
- What Do I Do If the Number of RDS Database Connections Reaches the Upper Limit?
- What Is the Maximum Number of Connections to an RDS DB Instance?
- How Can I Create and Connect to an ECS?
- What Should I Do If an ECS Cannot Connect to an RDS DB Instance Through a Private Network?
- What Should I Do If a Database Client Problem Causes a Connection Failure?
- What Should I Do If an RDS Database Problem Causes a Connection Failure?
- How Do My Applications Access an RDS DB Instance in a VPC?
- Do Applications Need to Support Reconnecting to the RDS DB Instance Automatically?
- Why Cannot I Ping My EIP After It Is Bound to a DB Instance?
- How Can I Obtain the IP Address of an Application?
- Can I Access an RDS DB Instance Over an Intranet Connection Across Regions?
- Is an SSL Connection to a DB Instance Interrupted After a Primary/Standby Switchover or Failover?
- Database Migration
- Database Permission
- Database Storage
- Client Installation
- Backup and Restoration
- Database Monitoring
- Capacity Expansion and Specification Change
- Database Parameter Modification
- Network Security
- Change History
- Troubleshooting
- Videos
Creating a Concurrency Control Rule
Scenarios
You can create rules to control concurrent execution of SQL statements by specifying SQL type, keywords, and maximum concurrency. To maintain better performance at high concurrency, SQL statements that meet the specified SQL type and keyword and exceed the maximum concurrency will not be executed.
High SQL concurrency can be caused by the following factors:
- A sharp increase in requests: Concurrent SQL statements of a certain type surge due to cache penetration and abnormal calls.
- Stacked slow queries: If a large number of SQL statements without indexes are called, many slow SQL statements will be generated, affecting services.
Supported Versions
Concurrency Control is available to the RDS for MySQL versions listed in Table 1.
Major Version |
Minor Version (Primary Instance) |
Minor Version (Read Replica) |
Setting Rules for Read Replicas Separately |
---|---|---|---|
5.6 |
≥ 5.6.50.3 |
≥ 5.6.51.6 |
Not supported |
5.7 |
≥ 5.7.31.4 |
≥ 5.7.37.1 |
≥ 5.7.38.221000 |
8.0 |
≥ 8.0.25.1 |
≥ 8.0.25.1 |
Not supported |
In some versions, concurrency control rules are not applied to requests sent by user root. For details, see Table 2.
Constraints
- A maximum of 100 concurrency control rules can be configured.
- Only SELECT, UPDATE, DELETE, and INSERT statements are supported for concurrency control.
- INSERT statements are only supported for RDS for MySQL 5.7 (5.7.44.240100 or later) and 8.0 (8.0.32.240100 or later) for concurrency control. To use this function, contact customer service to apply for required permissions.
- If a SQL statement matches multiple concurrency control rules, only the most recently added rule is applied.
- SQL statements that have been executed before a concurrency control rule is added are not counted.
- If the replication delay is too long, adding or deleting a concurrency control rule for a read replica does not take effect immediately.
- Concurrency control rules are not applied to system tables.
- Concurrency control rules are not applied to SQL statements not used for data query, such as select sleep(***);.
- Concurrency control rules are not applied to stored procedures, triggers, or functions.
- You can run the following SQL statement through DAS to view the execution of concurrency control rules: select * from information_schema.rds_sql_filter_info;
- Too many concurrency control rules affect the database performance. Delete unnecessary rules after using them.
- Concurrency control rules are not applied to system databases.
Procedure
- Log in to the management console.
- Click
in the upper left corner of the page and choose Databases > Relational Database Service.
- On the Instances page, click the target DB instance name.
- In the navigation pane, choose DBA Assistant > Historical Diagnosis.
- Choose SQL Explorer > Concurrency Control.
- Toggle on the concurrency control switch
.
NOTE:
Concurrency control rules take effect only after concurrency control is enabled.
- Click Add Rule. Configure the parameters listed in Table 3.
Table 3 Parameter description Parameter
Description
SQL Type
There are four options: SELECT, UPDATE, DELETE, and INSERT.
Keyword
A maximum of 128 keywords (case-insensitive) 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 concurrency control rule. The keywords are separated by a tilde (~). In this example, the rule restricts the execution of only the SQL statements containing keywords select and a.
- Generate keywords from a SQL statement: You can enter a SQL statement and then click Generate Keyword. The generated keywords are for reference only. Exercise caution when using them.
SQL statements match the keywords from first to last. For example, if one rule contains the keyword a~and~b, the statement *** a>1 and b>2 can match the keyword, but *** b>2 and a>1 cannot.
Empty characters before and after each keyword will be ignored, for example, spaces, '\n', '\r', and '\t'.
Max. Concurrency
If the number of concurrent SQL statements matching the keyword exceeds this limit, the SQL statements will not be executed. The value ranges from 0 to 1,000,000,000.
Kill existing sessions that match this rule
If this option is selected, all sessions generated by users subject to this concurrency control rule will be killed.
For details about the versions where user root is not subject to concurrency control rules, see Table 2.
- Confirm the settings and click OK.
Follow-up Operations
To delete a concurrency control rule, locate it in the rule list and click Delete in the Operation column. In the displayed dialog box, click OK.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.