The Samba-Bugzilla – Bug 6881
--bwlimit option uses KiB/s, but is documented as (what amounts to) kB/s
Last modified: 2009-11-13 02:10:38 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.
Created attachment 4934 [details]
A patch to change the documentation to use "KiB/s" and "kibibytes per second".
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.