-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query cache bad performance on huge result set. #1482
Comments
I confirm the issue, although the cause is not a locking issue on QC.
The said query is faster without QC than with QC. In QC the whole resultset is stored as a single buffer. When returned from the QC, |
Fixed in 1.4.9 and 2.0.0 |
Hello!
I have a lot of services which periodically reload their configuration/state from mysql DB. Some tables in the DB have many rows. To decrease load on mysql server, I'm trying to use query caching function of proxysql.
Unfortunately, the query cache shows performance problems with heavy queries and a lot of client requests.
For testing this, I created test mysql table with 2M rows and size 512MB. Reading from the table takes about 5 seconds.
Test application runs 10-20 parallel threads which just reads the data from the table using query
SELECT * FROM db_load_test
in infinite loop with a small delay of 1 second between queries. The application connects to proxysql and proxysql connects to a single backend mysql server without load.There is one mysql query rule specifies caching the select query for 2 minutes.
Proxysql can process requests from the application without query caching, just sometimes below messages appear in the log:
main.cpp:1086:main(): [ERROR] Watchdog: 1 threads missed a heartbeat.
By default proxysql does not cache such heavy results, so I applied changes in configuration:
After changes are applied, proxysql shows rapid decrease in performance:
A lot of error messages from Watchdog appear in the log, until Watchdog aborts the proxysql process.
Statistics from query cache are fetched slowly:
Increasing
mysql-threads
andrestart_on_missing_heartbeats
does not help much.It seems while proxysql reads big data from the cache, the cache is locked and other threads can not get access to it.
The text was updated successfully, but these errors were encountered: