Wget under-reports data transfer rate ("bandwidth") by 5%

Wget can be used to measure download data rate. For example, wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip Then observe the progress meter and kill the process. IMHO, wget thinks a MB is 2^20 (== 1MiB), instead of 10^6. This results in a 5% error. (Softlayer seems to have made the same error.) Am I wrong? Have others noticed that? According to wget's definition of "bug", this error does not seem to be a "bug". Or? (It doesn't crash -- just gives a wrong answer, based on a wrong assumption.) -- Peter Renzland@gmail.com

Just off the top. Wget would not account for the packet overhead. 5% overhead may be reasonable depending on your MTU. On 03/22/2016 08:07 PM, Peter Renzland wrote:
Wget can be used to measure download data rate. For example, wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
Then observe the progress meter and kill the process.
IMHO, wget thinks a MB is 2^20 (== 1MiB), instead of 10^6. This results in a 5% error. (Softlayer seems to have made the same error.)
Am I wrong? Have others noticed that? According to wget's definition of "bug", this error does not seem to be a "bug". Or? (It doesn't crash -- just gives a wrong answer, based on a wrong assumption.)
-- Peter Renzland@gmail.com
--- Talk Mailing List talk@gtalug.org https://gtalug.org/mailman/listinfo/talk
-- Alvin Starr || voice: (905)513-7688 Netvel Inc. || Cell: (416)806-0133 alvin@netvel.net ||

On 16-03-22 08:07 PM, Peter Renzland wrote:
Wget can be used to measure download data rate. [snip] IMHO, wget thinks a MB is 2^20 (== 1MiB), instead of 10^6. This results in a 5% error. (Softlayer seems to have made the same error.)
Am I wrong?
If you are talking millions in currency, or objects you are talking about something that is a power of 10. If you are talking about millions in computer terms (ie. bytes), the value is a power of 2. It is all about the units. -- Cheers! Kevin. http://www.ve3syb.ca/ |"Nerds make the shiny things that distract Owner of Elecraft K2 #2172 | the mouth-breathers, and that's why we're | powerful!" #include <disclaimer/favourite> | --Chris Hardwick

Wget can be used to measure download data rate. For example,
wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
Then observe the progress meter and kill the process.
The information on this page maybe helpful: https://en.wikipedia.org/wiki/Binary_prefix#Deviation_between_powers_of_1024... The version of wget that I have is GNU Wget 1.16.3 built on darwin14.4.0. It appears that the most recent version is GNU Wget 1.17.1 I wonder whether the current version still uses 1 MB == 2^20 B, or whether it now uses 1 MB == 10^6 B. If someone is interested in this question, it would probably be easiest to simply try running the current Wget. Or one could look at the source, if one is so inclined. I thought someone here might be interested in the question. If not, I'll take it to FSF, but I thought I'd start local. -- Peter Renzland@gmail.com

It seems that the problem is bigger than Wget -- it seems to be FSF-wide: https://www.gnu.org/software/wget/manual/ That page gives sizes for various files, and it's clear that they are using kB, but they mean KiB. -- Peter Renzland@gmail.com

I just found something interesting: "Iperf uses 1024 × 1024 for megabytes and 1000 × 1000 for megabits." https://en.wikipedia.org/wiki/Iperf -- Peter Renzland@gmail.com

On Tue, Mar 22, 2016 at 08:07:12PM -0400, Peter Renzland wrote:
Wget can be used to measure download data rate. For example, wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
Then observe the progress meter and kill the process.
IMHO, wget thinks a MB is 2^20 (== 1MiB), instead of 10^6. This results in a 5% error. (Softlayer seems to have made the same error.)
Am I wrong? Have others noticed that? According to wget's definition of "bug", this error does not seem to be a "bug". Or? (It doesn't crash -- just gives a wrong answer, based on a wrong assumption.)
It used to juse say K/s or M/s and they didn't want to change it to KB and MB to avoid wasting characters on the line for the progress bar. I guess someone eventually did change it, but did not want to change it to KiB and MiB. If you use --report-speed=bits you get Mb/s and Kb/s and I think those are actually "correct". Pretty sure wget predates the existance of KiB and MiB anyhow and changing the meaning later could "break" things. Probably wouldn't though. -- Len Sorensen

On Mar 23, 2016, at 10:23, Lennart Sorensen <lsorense@csclub.uwaterloo.ca> wrote:
On Tue, Mar 22, 2016 at 08:07:12PM -0400, Peter Renzland wrote:
Wget can be used to measure download data rate. For example, wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
Then observe the progress meter and kill the process.
IMHO, wget thinks a MB is 2^20 (== 1MiB), instead of 10^6. This results in a 5% error. (Softlayer seems to have made the same error.)
It used to juse say K/s or M/s and they didn't want to change it to KB and MB to avoid wasting characters on the line for the progress bar. I guess someone eventually did change it, but did not want to change it to KiB and MiB.
If you use --report-speed=bits you get Mb/s and Kb/s and I think those are actually "correct".
Pretty sure wget predates the existance of KiB and MiB anyhow and changing the meaning later could "break" things. Probably wouldn't though.
I've confirmed that --report-speed=bits gives the correct rate. Also, Curl, with -w '%{speed_download}' gives the correct rate. -- Peter Renzland@gmail.com
participants (4)
-
Alvin Starr
-
Kevin Cozens
-
Lennart Sorensen
-
Peter Renzland