/mili

Monitor Slow Queries in MySQL

In an application we had many connection to MySQL database to insert and select data.
Always MySQL cup usage was about 30%, I googled and found a MySQL option which store slow queries in a log file.
That’s awesome !
You should add log-slow-queries to file /etc/my.cnf and restart MySQL service and here it is !

Go and check around ! make a tea for your self and after a while check log file in /var/run/mysqld/mysqld-slow.log

You can read more about this config in MySQL Reference