Bug 6881 - --bwlimit option uses KiB/s, but is documented as (what amounts to) kB/s
Summary: --bwlimit option uses KiB/s, but is documented as (what amounts to) kB/s
Status: RESOLVED FIXED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.1.0
Hardware: All All
: P3 trivial (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-09 12:52 UTC by Richard Laager
Modified: 2009-11-13 02:10 UTC (History)
0 users

See Also:


Attachments
A patch to change the documentation to use "KiB/s" and "kibibytes per second". (4.00 KB, text/x-diff)
2009-11-09 12:54 UTC, Richard Laager
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Laager 2009-11-09 12:52:50 UTC
The --bwlimit option seems to use KiB/s, as io.c's sleep_for_bwlimit() function divides by 1024. It's documented as "KBPS", "KBytes per second", and "kilobytes per second".

I'm going to attach a patch which standardizes all of this as KiB/s and "kibibytes per second", to match the actual usage.

Given that this is a network transfer rate, it'd be more proper (and consistent with other applications) to change the function to work in SI kilobytes per second (i.e. use 1000 instead of 1024), but that's backwards-incompatible. If you'd like to go this route, I can prepare a patch to that effect.
Comment 1 Richard Laager 2009-11-09 12:54:50 UTC
Created attachment 4934 [details]
A patch to change the documentation to use "KiB/s" and "kibibytes per second".
Comment 2 Wayne Davison 2009-11-13 02:10:38 UTC
I've both improved the docs and improved the option to be able to accept the same unit suffixes that are accepted by --max-size and --min-size.  This makes it clearer what --bwlimit=1000 is doing, and allows someone to specify --bwlimit=1000kb (aka --bwlimit=1mb) for a slightly lower transfer limit than --bwlimit=1MiB.