Measuring speeds
Tom Metro
tmetro-blu-5a1Jt6qxUNc at public.gmane.org
Sat Apr 4 15:57:53 EDT 2009
Doug wrote:
> What software do you like to use to measure download speeds?
wget. I have a cron job that runs the below script periodically, and a
logwatch filter that summarizes the min/average/max. It works by pulling
a file from some ISP that has made said file available specifically for
bandwidth testing. This obviously tests only download and is limited in
accuracy due to only downloading from one server.
-Tom
#!/bin/sh
LOG='/var/log/monitor-bandwidth.log'
TEST_FILE='http://insanepwning.net/speedtest/7MB'
REPORT='/tmp/bandwidth-report'
DATE=`date '+%F %X'`
wget --output-document=/dev/null --tries=3 $TEST_FILE > $REPORT 2>&1
RATE=`perl -ne 'm/\((\d+.\d+ KB\/s)\)/ && print "$+\n"' $REPORT`
if [ "$RATE" != "" ]; then
echo $DATE $RATE >> $LOG
else
ERROR=`cat $REPORT`
echo $DATE $ERROR >> $LOG
fi
More information about the Discuss
mailing list