Rsync ionice destination

high-loadionicerate-limitingrsync

To avoid rsync to starve the system and network we use ionice when starting rsync and set the --bwlimit parameter. For example:

ionice -c2 -n7 rsync -aH --bwlimit=30000 /foo root@dest.com:/

This does indeed help to ensure the source server remains responsive. However, the destination server become very slow due to disk io at 100% (as seen by the atop utility).

Is it possible to somehow use ionice at the destination server too? Perhaps via the rsync -e option? I'd prefer not to run the rsync daemon if possible.

Best Answer

Changing the rsync command or wrapping it in a shell script to include the ionice command/parameters is an option. Also, You can leverage the --rsync-path option, which tells rsync which command to execute on the remote server. Something like --rsync-path="ionice -c2 -n7 rsync" will ensure that ionice runs on the destination.

I'll add that ionice is not always effective, depending on the server configuration. It only works with the default CFQ I/O elevator. If you've done any storage system tuning, this approach may not be applicable.

Can you give an example of the load or help explain how started the systems become for resources during the copy? I would tend to delve deeper and see why an rsync, especially limited to the low rate you listed in your example, would cause so much trouble.

What are you copying? What is the hardware/OS setup?