MySQL innodb_row_lock_time is more than wall clock time

Posted on

Question :

We recently started graphing the innodb_row_lock_time status variable in our monitoring system.

I noticed something I can’t understand on a graph for a busy server:

Between 04:55PM and 04:57PM, the value of this counter changed from 488,101,000 to 488,504,000. The MySQL documentation says:

The total time spent in acquiring row locks, in milliseconds.

How is it possible that during those 2 minutes, the server spent 403,000 ms in acquiring row locks? 2 minutes is only 120,000 ms

The only explanation that comes to mind is that this value is a sum of all threads but I cannot find any documentation to confirm this theory.

The server is MySQL 5.1

Answer :

This metric is cumulative. You have to take delta to see the change in amount of time. Then you have to divide by elapsed time to normalize it to say time waited per minute for example.

Leave a Reply

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