What units does wget use for bandwidth?

4

When downloading, wget reports speed in "K/s". K...what? kilobits? kilobytes? 1024 or 1000?


Update:

wget -O /dev/null http://newark1.linode.com/100MB-newark.bin

produces "348 K/s". Meanwhile:

  • nethogs says "343 KB/sec" for the entire Wi-Fi connection
  • System Monitor says 364 "KiB/s" for the entire Wi-Fi connection
  • Tomato says "3010.44 kbit/s (367.48 KB/s)" for the Wi-Fi connection (which is consistent with decimal kilobits and binary kilobytes).

So we know it's kilobytes, and probably perverse kilobytes, since the number would be bigger for decimal kilobytes.

endolith

Posted 2010-09-03T16:14:25.760

Reputation: 6 626

Similar question for curl: http://superuser.com/q/951056/90668

– Flimm – 2015-08-05T10:58:18.240

Answers

2

I would guess K stands for kilobytes.

In the GNU Wget 1.12 Manual, K always stands for kilobytes.

harrymc

Posted 2010-09-03T16:14:25.760

Reputation: 306 093

Since kB can mean different things to different people, but at least 1kiB is equal to 1024 bytes everywhere. – Flimm – 2015-08-05T10:51:50.253

@Flimm: This question of standards is discussed in this answer.

– harrymc – 2015-08-05T11:01:30.547

2So would that be true kilobytes (1000 bytes), or binary kibibytes (1024 bytes)? Hard disk drive manufacturers seem to be the only ones that use kilo-, mega- and gigabyte units correctly. – paradroid – 2010-09-03T17:34:27.707

Well, yeah, that was my guess, too. I'm looking for reliable information, not guesses. – endolith – 2010-09-03T17:48:17.320

@jason404: wget was written by programmers, so K=1024. @endolith: Why don't you experiment with getting one same large file by the browser and by wget, and compare the figures? – harrymc – 2010-09-03T18:29:14.217

@endolith: a kilobyte is always 1024 bytes. With larger multipliers, storage device manufacturers use SI (decimal) prefixes, other people use either decimal or binary when measuring storage size, and everyone in computer-related fields uses binary prefixes for things other than storage size, including bandwidth. – Gilles 'SO- stop being evil' – 2010-09-03T19:13:39.470

5No way. kilo- and variants have meant "1000" for thousands of years. The sloppy usage of "k" to mean 1024 is an unholy abomination that should be killed with fire.

Besides, we're talking about networking here. Amongst network engineers, 1000 is the norm. "Gigabit internet" is actually 1,000,000,000 bits per second, as any sane person would expect, not 1,073,741,824 or whatever godawful number you get from powers of 2. – endolith – 2010-09-03T23:19:21.200

Accepted because of your suggestion to experiment and find out. :) – endolith – 2010-09-04T01:13:14.753

1

@harrymc: The bug report here discusses the fact that wget uses kibibytes (KiB) instead of kilobytes (KB) - http://savannah.gnu.org/bugs/index.php?22765

– paradroid – 2010-09-04T16:26:50.453

@jason404: Almost all web software nowadays uses KB when meaning kibibyte (1024 bytes). From my point of view, the "bug" report is a bit out of touch with reality. – harrymc – 2010-09-04T19:48:31.920

3

Whose reality? The Linux Programmer's Manual explicitly states that kB = 1000 B. http://www.kernel.org/doc/man-pages/online/pages/man7/units.7.html Mac OS X measures in multiples of 1000, too. I'm gonna go with the ubiquitous, standardized meaning that's been in use for the last few centuries, myself.

– endolith – 2010-09-04T20:22:59.113

@endolith: I won't argue, since the usage of K unfortunately has become a matter of personal taste. – harrymc – 2010-09-05T06:36:07.197