Manuel:getLagTimes.php

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:GetLagTimes.php and the translation is 40% complete.

Other languages:
Deutsch • ‎English • ‎Nederlands • ‎català • ‎español • ‎français • ‎italiano • ‎polski • ‎português • ‎português do Brasil • ‎suomi • ‎日本語

Détails

getLagTimes.php file is a maintenance script to display 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

# 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