Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When using rsync+ssh to access a remote machine, is there a way to "nice" the rsync process on the remote machine (to lower its priority)?

Editing the question to clarify:

backups  16651 86.2  0.1   3576  1636 ?        Rs   11:06   0:06 rsync --ser...

(rsync line snipped)

This is a backup cron job that normally runs at 4am, but when I happen to be awake (and committing, or using Bugzilla hosted on that same machine), it kills server performance, so I wanted a quick "hack" to try and fix it a bit.

share|improve this question
up vote 30 down vote accepted

You can use the --rsync-path option, eg.

rsync --rsync-path="nice rsync" foo remotebox:/tmp/
share|improve this answer
You might consider using ionice as well, e.g. --rsync-path="ionice -c 3 nice rsync", though modern Linuxes automatically reduce the IO priority for nice'd processes (see the man page I linked). – Jo Liss Jun 23 '11 at 12:57
I already tried that, but my sshd is still running at nice 0 – Felipe Alvarez Dec 3 '14 at 5:09
on FreeBSD like systems where you don't have ionice, setting the --bwlimit option is good for a nicer rsync. – deed02392 Jun 22 at 8:00
  • Taking the --rsyncpath option you have rsync --rsync-path="ionice -c 3 nice -n 12 rsync" localDirectory remoteHost:/tmp/
  • Taking the configuration file option you can change or uncomment in file /etc/default/rsync the RSYNC_NICE='17' value and the RSYNC_IONICE='-c3' value

For both the ionice value will be for hard disc priority

  • 1 -> Real time
  • 2 -> Best effort
  • 3 -> Ildle (when any other process is not using the HD)

for nice value for processor priority

  • -20 (most favorable to the process)
  • (default 10) if -n is not specified
  • 19 (least favorable to the process)
share|improve this answer
Who is responsible for /etc/default/rsync? Is rsync itself reading this file, or is this done by the linux-flavor/distribution? – guettli Apr 20 at 9:24
... I think I found the solution /etc/default/rsync is the defaults file for rsync daemon mode. I guess it only applies if you connect to the rsync daemon via rsync-protocol. I guess it does not apply if you call it via ssh. – guettli Apr 20 at 9:26

Quick and dirty solution would be to create a small wrapper script called 'rsync' that shadows the $PATH before real rsync binary like:

nice -10 /path/to/proper/rsync $*

Or setup the authorized_keys file so that it performs nicing of rsync. (Assuming you are using ssh keys).


command=”/home/user/bin/" ssh-dss asdf....

Now in your /home/user/bin/

  rsync\ --server*)


share|improve this answer

You could disable the compression along the network, by not including the -z argument, that might save some CPU time on either side. Or change how rsync uses checksums, look at --checksum

share|improve this answer
I accepted Hasturkun's answer (since it answered my question), but you brought up a good point: I benchmarked with compression vs without compression, and it only added 2 minutes to the job. I just got so used to using -avz as my flags that I never thought of dropping -z. – mwalling Aug 18 '09 at 15:35
My habit is to use -aPh, I rarely use -z – Rory Aug 18 '09 at 15:57

Rsync should not be using much CPU. I doubt that you can force a certain niceness from the other end, but what you could do is limit the bandwidth that rsync is using with a firewall, which would ultimately reduce how much processing it could do in X amount of time.

share|improve this answer
Added some output from 'ps aux' to show what it is doing as far as CPU. I'm going over a slow link, so I have the --compress option turned on, but it is also causing a good amount of disk access, which I was hoping to knock down by using nice (unintended side effect) – mwalling Aug 18 '09 at 15:11
Setting a nice value usually also affects the I/O niceness, which is what someone usually wants. – Bram Schoenmakers Aug 24 '10 at 7:46

I don't think so, you need a custom solution for that.. use ftp

share|improve this answer
You know, that is a good idea. Who needs all of the features of rsync like being able to run over ssh with out needing a daemon running on the remote machine (and the inherent encryption of ssh), transfer compression, resuming downloads, only transferring the differences... thats all feature bloat. I'm going to run home right now and use my PS/2 System 60 to FTP some anime! – mwalling Aug 18 '09 at 15:24
Please delete this answer as it fails to answer the question and offers an alternative significantly worse than the example in the question. – user1133275 Apr 12 '15 at 3:11

Your Answer


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.