Wednesday, August 20, 2008

Keeping an eye on website performance

As reported, our Wiki's performance has been suffering lately, but the problem was intermittent. As these types of problems are hard to catch, I wrote a small shell script that would log the time it takes to log into the wiki and access a page as an authenticated user. In true MythBuster style, there's also a control value -- how long it takes to pull the home page from, which we never get complaints about.


while [ 1 = 1 ]; do

# Log in and save cookies
A=$(date +%s)

wget -q --no-check-certificate --delete-after --save-cookies=cookies.txt \\&wpPassword=mypass\& \\&action=submitlogin\&type=login

B=$(date +%s)
let DIFF=B-A

# Get a page as an authenticated user
wget -q --no-check-certificate --delete-after \
--header="Accept-encoding: gzip,deflate"--load-cookies=cookies.txt \
C=$(date +%s)
let DIFF2=C-B

wget -q --delete-after --header="Accept-encoding: gzip,deflate"
D=$(date +%s)
let DIFF3=D-C

echo "$NOW: Login: $DIFF Access page: $DIFF2 www home: $DIFF3"

sleep 300s

By running this for a few days from a computer some 3500km away, I was able to determine that the problem wasn't with the actual Wiki software or servers, but with our PIX firewall that was throttling incoming connections. Establishing a connection could take up to 40 seconds during peak times.

Now the Wiki is now much happier, but we still have some tricks up our sleeve to make things better. Matt will be moving the Wiki to an isolated cluster soon (it is currently sharing the CVS/downloads cluster) and configure the PHP engine to use APC.


Post a Comment

<< Home