Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

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?

share|improve this answer
    
We have several OpenVZ hosts. These are 16-core Xeon machines running CentOS. Each night we copy all OpenVZ containers to another hosts. Since our IP addresses are routeable to all hosts, this allows us to quickly activate a backup VPS in case a host fails. –  Jason Smith Apr 20 '12 at 13:40
    
How high does the load get? Are these local-to-local copies? Have any changes been made to the storage I/O elevators? –  ewwhite Apr 20 '12 at 13:42
    
From what I have seen, limiting network bandwidth does not limit disk io (thousands of directories need to be scanned, even if no files have changed). Should --bwlimit also limit disk i/o? –  Jason Smith Apr 20 '12 at 13:46
    
According to atop the disk io is constantly bursting to 100%. I am not sure what you mean by "storage I/O elevators", so I probably run the defaults? –  Jason Smith Apr 20 '12 at 13:48
add comment

Your rsync command launches rsync command at the remote destination, too.

Try to put the following to your destination server root user .bashrc, in other words to to /root/.bashrc

alias rsync="ionice -c2 -n7 rsync"
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.