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

Q. 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'd like to reduce both disk I/O and network I/O. I've 10Mbps server connection and 160GiB SATA hard disk. How do reduce disk I/O so that the entire system doesn't die or become unresponsive?

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

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

ionice command provide more control as compare to nice command. This program sets the io scheduling class and priority for a program or script. You can totally control disk i/o. Please see following article for detailed examples:

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

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

Previous post: How To Set Red hat / CentOS Linux Remote Backup / Snapshot Server

Next post: How To Simulate Linux Package Upgrade Without Installing Anything ( Dry Run )