rsync with reduced IO not just reduced bandwidth

Everone using rsync on a daily basis has noticed that IO tends to get stressed quite a bit. So if you are sitting on the machine wathing it you can „nice“ the process right then and there by hand.

Of course you could limit the bandwidth.

--bwlimit=KBPS limit I/O bandwidth; KBytes per second

Reducing bandwidth however does just that, reduce bandwidth.

But what if you need to sync a fat archive from server A to server B both in your network and being used while you are trying to sync?

Either you wait till the weekend, trash your free time and got to work on sunday or you „nice“ the whole rsync job and just let it run whenever the server has got some spare time. In short it would look like this:

ionice -c 3 rsync -ahv /data/source/* /data/destination/

The rsync option can stay the way you want them, thiose above are just mine. But you need to run the whole thing with ionice. On Debian and Ubuntu install as usual with apt-get. Important ist that you use that to run your rsync with the option -c 3 which according to the man page means:

-c class
The scheduling class. 0 for none, 1 for real time, 2 for best-effort, 3 for idle.

By using 3 we are telling it to only run rsync when there is idle time available and we are not bothing anyone else.

Schreibe einen Kommentar