Manual:getLagTimes.php

From MediaWiki.org
Jump to: navigation, search
MediaWiki File: getLagTimes.php
Location: maintenance/
Source code:

master 1.20.61.19.7

Classes: None

getLagTimes.php is a simple maintenance script that displays replication lag times from $wgLoadBalancer.

The script can be repeatedly called from the command line to create a simple 'lagtop' script that monitors a cluster's status.

# simple shell script to run getLagTimes.php every five seconds
while [true]
do
    php getLagTimes.php
    sleep 5
done
# sample output
** enwiki cluster **
10.0.0.236      db3.pmtpa.wmnet   0 
10.0.0.235      db2.pmtpa.wmnet   0 
10.0.0.237      db4.pmtpa.wmnet   8 ********
10.0.0.102   samuel.pmtpa.wmnet   1 *
10.0.0.232  thistle.pmtpa.wmnet   1 *
10.0.0.231     ixia.pmtpa.wmnet   1 *
10.0.0.233  lomaria.pmtpa.wmnet   1 *
10.0.0.101    adler.pmtpa.wmnet   0 

** dewiki cluster **
10.0.0.101    adler.pmtpa.wmnet   0 
10.0.0.102   samuel.pmtpa.wmnet   0 
10.0.0.232  thistle.pmtpa.wmnet   0 
10.0.0.231     ixia.pmtpa.wmnet   0 
10.0.0.234      db1.pmtpa.wmnet   0 
10.0.0.233  lomaria.pmtpa.wmnet   0 
 10.0.0.24  holbach.pmtpa.wmnet   0 

ctrl+C to quit