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.

My Laptop and my workstation are both connected to a Gigabit Switch. Both are running Linux. But when I copy files with rsync, it performs badly.

I get about 22 MB/s. Shouldn't I theoretically get about 125 MB/s? What is the limiting factor here?

EDIT: I conducted some experiments.

Write performance on the laptop

The laptop has a xfs filesystem with full disk encryption. It uses aes-cbc-essiv:sha256 cipher mode with 256 bits key length. Disk write performance is 58.8 MB/s.

iblue@nerdpol:~$ LANG=C dd if=/dev/zero of=test.img bs=1M count=1024
1073741824 Bytes (1.1 GB) copied, 18.2735 s, 58.8 MB/s

Read performance on the workstation

The files I copied are on a software RAID-5 over 5 HDDs. On top of the raid is a lvm. The volume itself is encrypted with the same cipher. The workstation has a FX-8150 cpu that has a native AES-NI instruction set which speeds up encryption. Disk read performance is 256 MB/s (cache was cold).

iblue@raven:/mnt/bytemachine/imgs$ dd if=backup-1333796266.tar.bz2 of=/dev/null bs=1M
10213172008 bytes (10 GB) copied, 39.8882 s, 256 MB/s

Network performance

I ran iperf between the two clients. Network performance is 939 Mbit/s

iblue@raven $ iperf -c 94.135.XXX
------------------------------------------------------------
Client connecting to 94.135.XXX, TCP port 5001
TCP window size: 23.2 KByte (default)
------------------------------------------------------------
[  3] local 94.135.XXX port 59385 connected with 94.135.YYY port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.09 GBytes   939 Mbits/sec
share|improve this question
1  
rsync:// protocol or tunneling over SSH? There's very definite performance limitations in the latter¹. –  ephemient Apr 8 '12 at 0:00
add comment

3 Answers 3

up vote 4 down vote accepted

Another way to mitigate high CPU usage but still keep the functionality of rsync, is by moving from rsync/SSH to rsync/NFS. You could export the paths you want to copy from via NFS and then use rsync locally from the NFS mount to your destination location.

In one test from a WD MyBook Live network disk, one or more rsyncs from the NAS on a Gigabit network towards 2 local USB disks would not copy more than 10MB/sec (CPU: 80% usr, 20% sys), after exporting over NFS and rsyncing locally from the NFS share to both disks I got a total of 45MB/sec (maxing out both USB2 disks) and little CPU usage. Disk utilization when using rsync/SSH was about 6% and using rsync/NFS was closer to 24%, while both USB2 disks where close to 100%.

So we effectively moved the bottleneck from the NAS CPU to both USB2 disks.

share|improve this answer
    
That was what I finally did, after some more experiments. –  iblue Aug 2 '12 at 22:53
    
Be warned, though, that NFS offers no security (ie: encryption). –  Hugo Jul 8 '13 at 2:31
add comment

Compression, encryption, the number and size of files being copied, your source and destination systems' disk I/O capabilities, TCP overhead... These are all factors that can influence the type of transfer you're conducting.

Please post the rsync command you're using and provide details on the specifications of both computers.


Edit: Encryption is often a limiting factor in rsync speeds. You can run with ssh and a lighter-weight encryption cipher like arcfour

Something like: rsync -e "ssh -c arcfour"

Or you can use a modified rsync/ssh that can disable encryption. See hpn-ssh: http://psc.edu/networking/projects/hpn-ssh

But again, your laptop has a slow drive compared to your workstation. Writes may be blocked and waiting for I/O going to your laptop. What are your real performance expectations?

share|improve this answer
1  
Laptops often have slower (7200 rpm - 5400 rpm) disks because they use less power. This could easily be your limiting factor depending on exactly what the rsync is doing. –  Ladadadada Apr 7 '12 at 23:43
    
thanks. For rsyncning from an dm-crypt encrypted disk attached to a atom processer to an ecryptfs ARM NAS box, this changed my transfer speed from 4MiB/s to 6MiB/s. rsync --protocol=29 -auh --progress /mnt/esata/pics/ -e "ssh -c arcfour" diskstation:/volume1/pics Better than nothing. –  Sebastian May 26 '13 at 15:28
add comment

After some more testing, I finally found the answer myself. rsync uses tunneling over ssh by default. The crypto makes it slow. So I needed to get around that crypto stuff.

Solution 1: Setting up an rsync server

To use it via the rsync protocol, you have to set up an rsyncd server. There was an /etc/init.d/rsync script on my laptop, so I guessed, rsyncd was running. I was wrong. /etc/init.d/rsync start exists silently, when rsync is not enabled in /etc/default/rsync. Then you also have to configure it in /etc/rsyncd.conf, which is a pain.

If you get all this done, you have to use rsync file.foo user@machine::directory. Please note, that there are two colons.

Solution 2: Old-school rsh-server

However, the configuration was way to complicated for me. So I just installed and rsh-server on my laptop. Invoking rsync on the workstation with -e rexec then uses rsh instead of ssh. Which then almost doubled the performance to 44.6 MB/s. Which is still slow. The speed bounces between 58 MB/s and 33 MB/s, which indicates there may be some buffer or congestion control problems. But thats beyond the scope of this question.

share|improve this answer
    
We use rsync extensively here and usually get full interface speed unless traversing millions of 4K files. I don't think the crypto is the problem unless you're using some seriously decrepit hardware. –  Magellan Apr 8 '12 at 15:16
    
Does a Intel Core2 Duo T8100 in an ThinkPad R61 count as seriously decrepit hardware? If not, why is rsync over ssh slower than rsync over rsh then? –  iblue Apr 8 '12 at 15:51
1  
Encryption is often a limiting factor in rsync speeds, along with the number of files. The standard approaches to improving this are either to run rsync with a lighter encryption cipher like rsync -e "ssh -c arcfour" or trying a modified rsync/ssh that can disable encryption. See hpn-ssh: psc.edu/networking/projects/hpn-ssh –  ewwhite Apr 8 '12 at 17:17
add comment

protected by Chris S Apr 20 '13 at 2:43

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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