You are browsing a read-only backup copy of Wikitech. The primary site can be found at wikitech.wikimedia.org

Checking MySQL replication

From Wikitech-static
Jump to navigation Jump to search

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