As a Database Administrator you should be aware about the slow queries .  When you are running a high traffic website with multiple mysql servers , you have to be very careful about long running queries, ideally all queries should get executed below 2 seconds for high traffic site as there are thousands of database queries are coming to the mysql read servers. If one query get locked in MyISAM then the subsequent all the queries will get locked and finally your site will collapse.

The slow query log consists of all SQL statements that took more than long_query_time seconds to execute and required at least min_examined_row_limit rows to be examined. The time to acquire the initial table locks is not counted as execution time. mysqld writes a statement to the slow query log after it has been executed and after all locks have been released, so log order might be different from execution order.

The best way to handle this situation is using a third party tool called mkill (Twitter is using this utility to kill long running queries.)

Read more here to use mkill  How to Install and Configure mkill – Kills slow queries

Post By Gishore J Kallarackal (2,121 Posts)

Gishore J Kallarackal is the founder of techgurulive. The purpose of this site is to share information about free resources that techies can use for reference. You can follow me on the social web, subscribe to the RSS Feed or sign up for the email newsletter for your daily dose of tech tips & tutorials. You can content me via @twitter or e-mail.

Website: → Techgurulive

Connect