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 www.eclipse.org, which we never get complaints about.

#!/bin/sh
#

while [ 1 = 1 ]; do
NOW=$(date)

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

wget -q --no-check-certificate --delete-after --save-cookies=cookies.txt \
--post-data=wpName=mylogin@eclipse.org\&wpPassword=mypass\&wpDomain=bugs.eclipse.org \
https://wiki.eclipse.org/index.php?title=Special:Userlogin\&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 \

http://wiki.eclipse.org/BIRT_PMC_Minutes
C=$(date +%s)
let DIFF2=C-B

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

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

sleep 300s
done


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.

0 Comments:

Post a Comment

<< Home