what is the default rate unit in wget?
When I use wget to download a large file, it gives me "56M/s". I want to know if it means 56 megabits per second or 56 megabytes per second. Thanks!
Like this:
231,997,440 61.4M/s in 4.0s
It's megaBytes. Apart from anything else, if you divide the file length (231997440 bytes) by the time (4.0s) you get the same answer (give or take).
Edit: if you merely want to set the text output for the rate, so it displays eg "MB" instead of just "M", it's free software, you can always recompile it yourself. But it may be worth checking if there's a newer version of wget, since both mine (1.11.4 and 1.12) seem to display the B:
2011-08-22 09:12:06 (3.53 MB/s) - “openmoko.odp” saved [3635800/3635800]
The output shown is in Megabytes/second you may also see Kilobytes/second and I guess but very unlikely bytes/second.
If you want to rate limit the download to a specific spped you can use the --rate-limit
switch
--rate-limit=56M will limit the download to 56Mb/s.
‘--limit-rate=amount’
Limit the download speed to amount bytes per second. Amount may be
expressed in bytes, kilobytes with the ‘k’ suffix, or megabytes with the ‘m’ suffix. For example, ‘--limit-rate=20k’ will limit the retrieval rate to 20KB/s. This is useful when, for whatever reason, you don't want Wget to consume the entire available bandwidth.
This option allows the use of decimal numbers, usually in
conjunction with power suffixes; for example, ‘--limit-rate=2.5k’ is a legal value.
Note that Wget implements the limiting by sleeping the appropriate
amount of time after a network read that took less time than specified by the rate. Eventually this strategy causes the TCP transfer to slow down to approximately the specified rate. However, it may take some time for this balance to be achieved, so don't be surprised if limiting the rate doesn't work well with very small files