2010/1/27 Miguel Araújo <noradone@stripped>:
> I want to measure replication speed for a great number of replicas. By that I mean
> how soon an event arrives at the slave after being logger to the master's binary log.
> So, I've started developing an application to read the replication logs in order to
> compare them (compare by time, the log position on the master node with the log position
> on the slave's). My first approach was to use the mysqlbinlog to get the log position, in
> the 'Master_Log_File'. But in the slave's the last position that the SQL thread has read
> and executed is the 'Relay_Log_Pos', right?
> I have to read the slave's relay log, in order to get the last position on the
> Master's log executed? And compare with the master's log?
May be the field "Seconds_Behind_Master" could help you ? (when you
run "SHOW SLAVE STATUS" on your slave)
according to the mysql doc (
"When the slave SQL thread executes an event read from the master, it
modifies its own time to the event timestamp. (This is why TIMESTAMP
is well replicated.) In the Time column in the output of SHOW
PROCESSLIST, the number of seconds displayed for the slave SQL thread
is the number of seconds between the timestamp of the last replicated
event and the real time of the slave machine. You can use this to
determine the date of the last replicated event. Note that if your
slave has been disconnected from the master for one hour, and then
reconnects, you may immediately see Time values like 3600 for the
slave SQL thread in SHOW PROCESSLIST. This is because the slave is
executing statements that are one hour old. "
> Thank you.
> Miguel Araújo
Excuse my poor english level :)
> MySQL Replication Mailing List
> For list archives: http://lists.mysql.com/replication
> To unsubscribe: http://lists.mysql.com/replication?unsub=1