Throttle The Disk I/O Rate: Limit disk I/O For rsync Tool

by on July 5, 2008 · 5 comments· last updated at September 2, 2012

I run a backup script called /root/backup.sh which runs rsync command. However, rsync makes a lots of disk I/O and network I/O. I would like to reduce both disk and network I/O. My server has 10Mbps server connection with 160GB SATA hard disk. How do I reduce disk I/O so that the entire system does not die or become unresponsive?

This is a well known issue. There are two methods to control or throttle the disk and network I/O rate under UNIX / Linux while using the rsync command.

Method # 1: Limit I/O bandwidth

The --bwlimit option limit I/O bandwidth. You need to set bandwidth using KBytes per second. For example, limit I/O banwidth to 10000KB/s (9.7MB/s), enter:
# rsync --delete --numeric-ids --relative --delete-excluded --bwlimit=10000 /path/to/source /path/to/dest/

Method # 2: Take control of I/O bandwidth using ionice utility

The ionice command sets the io scheduling class and priority for a program or script. You can totally control disk i/o. See the following article for detailed examples:



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 5 comments… read them below or add one }

1 anonymous December 8, 2011 at 11:00 am

Thanks

Reply

2 anonymous February 7, 2012 at 2:05 am

Check your grammar…. ionice command provide more control as compare to nice command.

should read:

The ‘ionice’ command provide more control as compare to the ‘nice’ command

r3dk1ng

Reply

3 anon March 24, 2013 at 8:55 am

redking… it’s as “compared to” not “as compare” to… check your grammar too if you wanna complain :)

Reply

4 Michael Mounteney August 30, 2012 at 12:52 am

Hilarious ! English as she is spoke.

Reply

5 Balu November 19, 2012 at 1:40 pm

Thank you
server load due to rsync was driving me mad

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as: , , , , , , , , , ,

Previous Faq:

Next Faq: