Tuesday 5 October 2010

Compiling!

When I am writing software sometimes XKCD is accurate!

Alas I can only fully participate in that activity when the boys get home from school.

The rest of the time I have to make do with other distractions.

I am currently participating in a "higher" speed broadband trial (I already have a 50Mbit service). This appears to involve the drastic step of remotely reconfiguring my Cable Modem :-)

In the last week there has been the odd request from the trial organisers to test throughput using various website based testing applications. These applications seem completely unable to cope with these 50Mbit+ connections and the results are as unreliable as expected.

To address this the trial organisers asked us to time downloading of a gigabyte file from one of their servers. I was surprised to discover that it took over 350 seconds to download the example file giving a less than stellar 3Megabyte/second rate.

So I used some "compiling" time today to look at what was going on. Firstly I went looking for an iperf like tool for http. Turns out there isn't one which came as a bit of a surprise...oh well with a little help from my friends I came up with
curl -o /dev/null http://target.domain/1GB.bin 2>&1 | tr "\r" "\n" |awk '{print $12 }' >test1.dat
Which gets a file with a "Current transfer speed" for each second of the transfer. Well ok so lets do the transfer a few times and collect the output so we have a reasonable data set.

So we have a pile of numbers...not terribly useful, lets visualise them! to the gnuplot mobile!

We need a gnuplot script something like say this:
set terminal png nocrop enhanced font arial 8 size 1024,600 xffffff
set output 'xfer.png'
set style data linespoints
set title "1Gigabyte file transfer throughput"
set ylabel "Throughput in Kilobytes per second"
set y2label "Speed in Megabits per second"
set xlabel "Seconds of transfer"
set ytics 1024
set y2tics ("10" 1220, "20" 2441, "50" 6102, "100" 12204)
set grid noxtics y2tics
set yrange [0:13000]
set datafile missing "-"
plot 'test1.dat' using 1 title 'Test1', \
'test2.dat' using 1 title 'Test2', \
'test3.dat' using 1 title 'Test3'
Once run through gnuplot I extracted a lovely graph which shows a couple of things.

Mainly that even with a nice fat downstream you are unlikely to realise the maximum throughput very often even from a server on your ISP local network.

On the other hand I now have a way to examine throughput of downloads ;-)

No comments:

Post a Comment