If you are in doubt that some really slow queries are taking place on your server and they put you on too much load, then use this change in the configuration file to enable logging of slow queries:

The config files usually is /etc/mysql/my.cnf. Uncomment these:

slow-query-log = 1

slow-query-log-file = /var/log/mysql/mysql-slow.log

long_query_time = 1

log-queries-not-using-indexes

The last is not mandatory, but if you got a big db, it would be good if you have a reason to consider indexes, if you got too many queries without ’em.

You can read more here:

https://rtcamp.com/tutorials/mysql/slow-query-log/

Leave a comment

Your email address will not be published. Required fields are marked *