One of item I always look at SHOW ENGINE INNODB STATUS to see if
there are any transactions spending very long time in ACTIVE
state. In the perfect world if you’re running online system you
should not see transactions spending more than couple of seconds
in ACTIVE state. Especially ACTIVE transactions which do not
currently run any query are suspicious. There are however cases
when screaming fire about ACTIVE transactions alone would be
misleading. There is a whole set of applications which run quite
fine while having ACTIVE measured in hours. It is JAVA
applications which often run in AUTOCOMMIT=0 mode and do not
explicitly commit transactions unless there were any writes. If
database is configured in READ-COMMITTED transaction mode it is
actually fine from performance point of view as Innodb does not
have to preserve row versions going back to start of
transactions.
There is however a better metric, which in most cases will …
[Read more]