My rsync is saturating my connection. How do I cap its bandwidth?

Quick Linux Tip #52:

Try: rsync -avz --bwlimit=5000 /source/ linuxteck@backup:/dest/

Info: --bwlimit=5000 limits rsync's transfer rate to about 5,000 KB/s, helping prevent large file transfers from consuming all available network bandwidth.

Examples:

  • $ rsync -avz --bwlimit=10M /src/ user@host:/dst/  # Limit to 10 MB/s
  • $ scp -l 40000 file.iso user@host:  # Limit SCP bandwidth in Kbit/s
  • $ wget --limit-rate=5m http://example.com/big.iso  # Limit wget transfer rate

Note: rsync's --bwlimit value is expressed in bytes per second unless a supported suffix is used. SCP's -l option uses Kbit/s, so its value is not directly comparable to rsync's. Test bandwidth limits during peak hours to find a balance between transfer speed and network availability.




LinuxTeck.com
linuxteck@ubuntu:~$ rsync -avz --bwlimit=5000 /source/ linuxteck@backup:/dest/
sending incremental file list
large_file.iso
      4,712,349,696 100%    4.88MB/s    0:15:20
report.pdf
          234,567 100%    4.85MB/s    0:00:00

sent 4,712,584,263 bytes  received 234 bytes  4,882,412.65 bytes/sec
total size is 4,712,583,996  speedup is 1.00
linuxteck@ubuntu:~$

PREVIOUS ARTICLE Quick Linux Tip #51: How do I know exactly when a file gets created, modified, or deleted?
About John Britto

John Britto Founder & Chief-Editor @LinuxTeck. A Computer Geek and Linux Intellectual having more than 20+ years of experience in Linux and Open Source technologies.

View all posts by John Britto →

Leave a Reply

Your email address will not be published.