SQL Throttling
Being able to limit the number of requests for certain requests when facing peak traffic is often an important means of protecting the backend database.
Through the SQL throttling feature of the database proxy, it can timely limit the concurrent requests of a certain type of SQL, guarantee the normal operation of the database under extreme circumstances, and avoid overload.
Here are some common scenarios:
- Cache penetration or business interface being attacked, resulting in a surge in concurrent SQL requests.
- The data obtained by SQL is huge, and excessive requests can cause the database performance to decline
- The index is not set correctly or the SQL is too complex, occupying a lot of database CPU resources
Enter into SQL Throttling
Click on "Details" of the proxy to enter the details page
On the right side of the database proxy detail page is the SQL throttling template. Click the edit button to enter the SQL throttling settings page
There is a create template button in the upper left corner of the page. Click to display the create throttling template pop-up box
Create Throttling Template
On the throttling template page, you can set throttling for SELECT, UPDATE, INSERT, DELETE four types of SQL statements
Based on the actual business scenario, we can input the corresponding SQL statement. The system will automatically replace variables ("hello world") with placeholders to adapt to the incoming parameters
After configuring the throttling threshold, click confirm. You can see that the rules have been added to the list page
Update Throttling Template Threshold
After creating a throttling template, you can modify the throttling threshold. Click the edit button on the right side of the throttling value to set the threshold in a small pop-up box above
Disable and Enable Throttling Template
You can disable and enable the throttling template. Operating the switch-like small button on the right can disable and enable the throttling template
Delete Throttling Template
Throttling templates can also be deleted. After deletion, they will not be retained