Super User is a question and answer site for computer enthusiasts and power users. 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

Using rsync for copying some large files (24MB each):

bronger@steed:/tmp$ time rsync -r root@my_nas::media/distortion .

real    0m18.128s
user    0m2.600s
sys     0m5.756s

(Substract 2 seconds for typing the password.) Now, the same thing with NFS:

bronger@steed:/tmp$ time cp -a /mnt/media/distortion .

real    0m5.569s
user    0m0.036s
sys     0m2.128s

How can this be? There is no compression or encryption involved, yet the CPU usage on the server side is 100%. It is a NAS with a slow ARM CPU, but even then any copying action should be limited by IO.

The rsyncd.conf file says:

pid file = /var/run/
lock file = /var/run/rsync.lock
use chroot = no

path = /volume1/media 
comment = Main volume                      
fake super = yes                         
uid = 1000
gid = 1000    
read only = no
list = yes     
charset = utf-8  
auth users = root                 
secrets file = /etc/rsyncd.secrets
share|improve this question
You're changing both protocol and technique. Could you add a test with a local (directory to directory) rsync for comparison? – Daniel Beck Dec 29 '12 at 15:16
I may change the protocol, but the hardware (disk drives, network interface controllers) is the same, as is the rest of the software stack. If I rsync the local NFS mount (instead of cp), it takes 9 seconds. – Torsten Bronger Dec 29 '12 at 15:25
I found an LWN article. Maybe rsync is really so CPU-loading while transmitting large chunks of data that it shouldn't run on slow devices. – Torsten Bronger Dec 29 '12 at 15:48
up vote 3 down vote accepted

rsync is slower than NFS if rsync is CPU-bound. rsync is much less efficient than NFS when it comes to the mere transfer of the data. In my case, rsync consumed 100% CPU while NFS needed only 20%, and NFS was still faster by a factor of 3. This means that rsync comsumed 15 times (!) more CPU resources than NFS for the same amount of network traffic. I transfered large files.

The best approach in such a scenario is to mount the directory with NFS on the faster machine, and copy the files with rsync locally.

See an LWN article of someone with a similar problem.

share|improve this answer

RSync is going to do its homework before beginning to make sure that copying is even a requirement.

If you already had local versions of the files that were the same, rsync would have won because its smarter.

share|improve this answer
The directory to be copied didn't exist on the destination machine. It should take milliseconds for rsync to see this. So, the bulk work should be just to send all data through the wire -- in both cases, rsync and NFS. – Torsten Bronger Dec 29 '12 at 15:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .