MySQL slow query log
The MySQL slow query log enables you to log all queries that take longer than a specified number of seconds to execute. This should help identify any queries that are not performing sufficiently.
All that is required is two additional lines in the MySQL configuration file “my.cnf” in the [mysqld] section.
[mysqld]
log-slow-queries = /var/log/mysql-slow.log
long_query_time = 4
The above [...]