dolsen:
Edit - as the test progressed, the speed was getting faster.
With ookla,
There are a bunch of jpg files on the webserver hosting the speedtest.
The flash player makes an http get of the url http://server/speedtest/1000x1000.jpg? which is the pixel resolution (size) of the file. The URL has a ? on the end to indicate to any caches along the way to serve the file directly without a cached copy - but some caches can be configured to ignore that flag and serve a cached copy anyway.
The jpg file itself is made up of very many random pixels and colours so it is as big as possible, and not compressible. This is how the speedtest is able to work through a corporate proxy - by using standardised files.
The first couple of files are about 100kb in size and serve to provide the ping result, and gauge your speed.
It then will download an appropriate file based on what it thinks your internet speed is...
After a couple of seconds, it will add a couple more streams or parallel downloads and usually has about 5 going by the time it gets to the middle of the test.
There is no point it testing your 100mbit fibre connection with a 200 kilobyte file. So it downloads files of an appropriate size.
Each of those streams is subject to TCP windowing - which has a mechanism to gradually speed up as bandwidth is available. Multithreadding is done so the speed can ramp up as fast as possible than with a single file transfer and provide a more accurate result.
So if you are doing a test on a very fast connection, you will probably find you have downloaded 500mb+ of data.
I was hosting the napier ookla speedtest server for a few months but decided to take it down as we were getting more tests from india and africa than from NZ residents and it was annoying seeing our expensive bandwidth being used like that.