Rsync Throttle Upload Bandwidth --bwlimit=KBPS
I am looking to throttle the upload speed of my file transfers during an rsync process.
Does --bwlimit=KBPS mean it sets the internet transfer speed, or the hard drive disk write speed?
--bwlimit=KBPS limit I/O bandwidth; KBytes per second
Also, in the manual it says
Rsync can also be run as a daemon, in which case the following options are accepted:
And that's where the description for --bwlimit=KBPS is listed.
Does that mean rsync has to be run in daemon mode in order to use that command?
IF... --bwlimit=KBPS is referring to the internet transfer speed of my files...
Can anyone provide an example of how I can alter my command line in order to limit the upload speed of my file transfers using rsync?
Here is what I am currently using:
rsync -avz -e 'ssh' [email protected]:/var/www/* /var/www/
I tested with this extensively while I was setting up my in house yum repositories.
This option seems to be intended - and in my opinion much more useful for - daemon mode but it does work correctly between local files and over SSH as well.
In your case the following should work.
rsync --bwlimit=x -avz -e 'ssh' [email protected]:/var/www/* /var/www/
The big thing to note is that the bwlimit option takes kilobytes per second not kilobits per second. That caused me some headaches until I reread the man page.
On more thing to add to this question is that bwlimit works file by file. If you're transferring millions of small files you'll never have a file transfer that lasts long enough to trigger the rate limiting. This has bitten my in the past when copying large maildir system when the average file was 10K.