Jump to content

Checking MySQL replication

From Wikitech

Checking replication delay

Look for the two system user accounts in the processlist. One is the control process, the other is the SQL worker process. The Time: field of the SQL worker process is the difference between the local system clock and the timestamp of the replication log entry that it is processing. If the clocks are synchronized, this is the replication delay in seconds.

mysql> show processlist \G
*************************** 2. row ***************************
     Id: 18736
   User: system user
   Host:
     db: NULL
Command: Connect
   Time: 5
  State: Waiting for master to send event
   Info: NULL
*************************** 3. row ***************************
     Id: 18737
   User: system user
   Host:
     db: jawiki
Command: Connect
   Time: 29
  State: Updating
   Info: UPDATE cur SET cur_counter = cur_counter + 1 WHERE cur_id = 97735