Today I was cloning the master using LVM Snapshot and found it was taking quite a while to catch up, which highlighted replication could be the limiting factor for this system quite soon, so I decided to check what is limiting MySQL Replication speed.
My first idea was to check it based on slow query log, happily
the server was running MySQL with slow query log with microsecond resolution so
I could check exactly which update queries take most time to
execute. Unfortunately it did not work because Slave thread seems
to have problems picking up long_query_time when
it is set online, meaning changing it via
set global long_query_time=0 and restarting
slave does not pick up the change.
I of course could just restart MySQL but this would make replication to be delayed few more hours …
[Read more]