I run a backup script called /root/backup.sh which runs rsync command. However, rsync makes a lot of disks 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 drive. 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.
How To Keep rsync From Using All Your Bandwidth on Linux/Unix/BSD Server

How To Keep rsync From Using All Your Bandwidth on Linux/Unix/BSD Server

Method # 1: Limit I/O bandwidth using rsync command

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/
# rsync -av --delete --numeric-ids --relative --delete-excluded \
--bwlimit=10000 \
/var/www/html vivek@server1.cyberciti.biz:/backups

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:

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 8 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
8 comments… add one
  • anonymous Dec 8, 2011 @ 11:00


  • anonymous Feb 7, 2012 @ 2:05

    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


    • anon Mar 24, 2013 @ 8:55

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

      • asdf@asdf.tld Jul 25, 2013 @ 15:33

        @anon, if you’re going to use quotes to illustrate the difference between original and corrective syntax, then you should use the quotes around the same group of words. Let me fix your poor correction to redking.

        Should be “as compared to”, not “as compare to”

        But then again, redking also missed pluralizing of provides.

        Here is the final corrected sentence that both of you screwed up:

        The ionice command provides more control as compared to the nice command.

        You are welcome.

        • LOL Apr 6, 2017 @ 8:24

          Please shut up and fix your own garden any time.

        • RD Jul 21, 2020 @ 11:10

          @ asdf@asdf.tld

          Actually, I believe that punctuation should precede a quotes symbol. So this would be correct:

          Should be, “as compared to,” not, “as compare to.”

          I mention this only because I find the corrections funny. Please feel free to correct my correction of the corrected correction.

  • Michael Mounteney Aug 30, 2012 @ 0:52

    Hilarious ! English as she is spoke.

  • Balu Nov 19, 2012 @ 13:40

    Thank you
    server load due to rsync was driving me mad

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum