cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl statistics are always off by about 5-10%

From: Dave Reisner <d_at_falconindy.com>
Date: Mon, 25 Mar 2013 08:52:39 -0400

On Mon, Mar 25, 2013 at 12:05:25PM +0100, Sven Lanckmans wrote:
>
> Hi,
>
> I'm using curl to measure bandwidth performance behind cable modems. Every
> result I see is 5-10% below what I would expect. (these tests are in a lab so
> I'm sure about allocated bandwidth).
>
> I've set up a local ftp server which has a file with size of 100MB.
>
> The cable modem has an allocated bandwidth of 15,36Mbps download and 512 Kbps
> upload. 
>
> Download test:
> /usr/bin/curl -O ftp://pcprobe:pcprobe@homeusers.brutele.be/100MB.dat -o /dev/
> null
>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
> Dload  Upload   Total   Spent    Left  Speed
> 100 95.3M  100 95.3M    0     0  1760k      0  0:00:55  0:00:55 --:--:-- 1761k
>
> Upload test:
> /usr/bin/curl -T 2MB-1.dat ftp://pcprobe:pcprobe@homeusers.brutele.be
>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
> Dload  Upload   Total   Spent    Left  Speed
> 100 2048k    0     0  100 2048k      0  60867  0:00:34  0:00:34 --:--:-- 26265
>
> 1) why is Total and Received showing 95.3M instead of 100M? (looking at the
> file that was downloaded I see a 100MB file)

The units curl uses aren't specific enough in the tool's output. You've
created a 100 megabyte (MB) file. Curl shows that you downloaded a 95.3
mebibyte (MiB) file.

> 2) the download speed is 1760kBps * 8 / 1000 = 14,08Mbps
> 3) the upload speed is 60867 * 8 /1000 = 486Kbps

Didn't do the math here, but I suspect it's the same "loss" due to
conversion of units.

> Every time I test this I get the same results and using other modems with other
> subscriptions (100Mbps/5Mbps) show the same behaviour.
>
> Is there maybe by default some overhead substracted from the reported results?
>
> Many thanks,
> Sven.
>
>
>

> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
> Etiquette: http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-03-25