Analyse slow-query-log using mysqldumpslow & pt-query-digest

Note: This is written for mysql version 5.5. Old mysql version has slightly different syntax.

Mysql can log slow queries which takes longer to execute. In some cases this is expected but some queries take longer because of coding mistakes. slow-query-log can definitely help you find those queries and make it easy to debug your application.

In WordPress world, many plugins are often coded my amateurs who have no idea about the scale at which big sites operate! Its better to use slow-query-log to find out such plugins.

Enable slow-query-log

You can enable slow-log by un-commenting following lines in /etc/mysql/my.cnf. If you’re using EE4, the location of mysql config file is mentioned in it’s documentation.

1 comment

Leave a comment

Your email address will not be published.