How to limit rsync speed and bandwidth usage using –bwlimit

rsync command is a fantastic tool to transfer data over hosts, however by default it uses all your available bandwidth and generates extra I/O. Recently one of my customers was streaming online radio and at the same time he was transfering some big files to an external server. He didn’t knew how to limit rsync speed and came to me seeking for help.

How can I avoid rsync from using all my bandwidth on Linux? How can I set a limit for rsync speed?

Today we will answer this questions related to rsync bwlimit.

Rsync speed can be limited to what ever you need, you just need to use a simple parameter callted ‘rsync bwlimit’ before the rest of the rsync options. Let’s see some examples.

You can easily limit I/O bandwidth using rsync –bwlimit option.

The rsync speed limit syntax is as you see below:

rsync --bwlimit=KBPS source destiny
rsync --bwlimit=KBPS [other options] source destiny

For example:

rsync --bwlimit=5000 -avpr [email protected]:/home/bigfiles/* /home/johndoe/

This will set a 5000KBytes limit per second for all files transfered using rsync.

Control your rsync speed limit using Nload

You can check the rsync bandwidth limit consumed in real time by using an utility like nload, which allows you to see bandwidth usage from the terminal, example:

rsync speed limit control using nload command
Screenshot of rsync speed limit control using nload command

On CentOS/RHEL you can install nload by using:

yum install nload

or

dnf install nload

For Ubuntu/Debian users:

apt-get install nload

That’s all, at this point you should know how to limit rsync speed using rsync bwlimit parameter, and have a full real time control of your bandwidth using nload command.

About the Author: Martin Keler

Leave a Reply

Your email address will not be published. Required fields are marked *