How to measure MySQL replication delay between 2 MySQL servers ( 1 Master 1 Slave ) ?
Given that two Xeon E5620 grade 1U servers are separate machine in same network segment, using MySQL Community Server 5.1 running in Ubuntu Linux Server 11.04.
How to measure MySQL replication delay between 2 MySQL servers ( 1 Master 1 Slave ) ?
Given that two Xeon E5620 grade 1U servers are separate machine in same network segment, using MySQL Community Server 5.1 running in Ubuntu Linux Server 11.04.
In MySQL command line, give command
and see the
Seconds_behind_ master
value.Or if you want to script that somehow, the one-liner below returns how many seconds behind master the slave currently is.
I guess it depends how accurate you want to be and for what purpose.
I update a record on the master and then do several reads from the slave until I get the updated record. I'm working with a slow connection between the two seperate offices. So 0.1 second resolution is good enough for me.