Skip to content
This repository has been archived by the owner on Dec 17, 2020. It is now read-only.

mysql/mariadb slow query log #1

Open
grooverdan opened this issue Apr 2, 2018 · 0 comments
Open

mysql/mariadb slow query log #1

grooverdan opened this issue Apr 2, 2018 · 0 comments

Comments

@grooverdan
Copy link

grooverdan commented Apr 2, 2018

Recommended to include in settings for monitoring slow queries of the server. I growing service like lvfs needs to be aware of database parts that slow down due to growth.

Ensure you have a logrotate rule in place for the log file. If you have selinux running /var/log/mysql/slow.log will be required as a location that is writable by logrotate and mariadb. Directory needs to be owned by mysql user.

Included for compatibility with mariadb/mysql for those who develop on both however reduce as you see fit:

[mariadb]
log_slow_verbosity='query_plan,explain'

[mysqld]
slow_query_log=1
long_query_time=0.1
log_queries_not_using_indexes=1
min_examined_row_limit=5000
slow_query_log_file=/var/lib/mysql/mysql-slow.log

[mysqld-5.7]
log_throttle_queries_not_using_indexes=20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant