Skip to content
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

SHOW MYSQL STATUS is slow if a lot of prepared statements are cached #1333

Closed
renecannao opened this issue Jan 13, 2018 · 1 comment
Closed

Comments

@renecannao
Copy link
Contributor

If a lot of prepared statements are cached, SHOW MYSQL STATUS (or any query against stats_mysql_global becomes slow because metadata related to all cached prepared statements are scanned in MySQL_STMT_Manager_v14::get_metrics() .
This doesn't simple make SHOW MYSQL STATUS slows, but also block traffic because of the held write lock.

@renecannao renecannao added this to the v1.4.5 milestone Jan 13, 2018
@renecannao renecannao self-assigned this Jan 13, 2018
renecannao added a commit that referenced this issue Jan 14, 2018
Prepared statements counters are now computed at runtime instead of on-demand.
Now MySQL_STMT_Manager_v14::get_metrics() doesn't depend anymore from the
number of prepared stataments cached.
The old code (slow code) is still present in the DEBUG version, and used to
validate the new counters. That also means that DEBUG versions are way slower
than non debug versions.
@renecannao
Copy link
Contributor Author

Bug fixed in 1.4.5 . Still pending to apply it on 2.0

pondix pushed a commit to pondix/proxysql that referenced this issue Feb 12, 2018
Prepared statements counters are now computed at runtime instead of on-demand.
Now MySQL_STMT_Manager_v14::get_metrics() doesn't depend anymore from the
number of prepared stataments cached.
The old code (slow code) is still present in the DEBUG version, and used to
validate the new counters. That also means that DEBUG versions are way slower
than non debug versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant