Pages

8.11.2014

rsync WTF

During the process of setting up my NAS box over the weekend, I discovered a curious thing about rsync.  The options that everyone on the internet seems to use, ("-avz") actually slow down the performance of rsync over LAN.  By slow down, I mean 20 MBps over gigabit ethernet. Theoretically, Gig-E can handle ~125 MBps.   Fortunately, the solution was simple.  Dropping the "z" flag (z enables compression) sped up my transfers to around 70 MBps.  

TLDR; use rsync -av, not rsync -avz

For those interested in the relevant details of my setup: I was using rsync to copy files locally from my Macbook to an SMB  mount point.  I'd also tested the speeds of rsync using the rsync protocol (rather than copying to a mounted volume) and they were equally poky.  NFS didn't fare much better.  It seemed to cap out around 40 MBps.   Strangely, SMB seems to be the fastest protocol for copying files in my setup.  Finder copies files even faster than rsync, pulling around 100 MBps.  My NAS box is a dual core Athlon X2 @3 GHz. I've got 4x 2 TB hard drives in RAID Z2 (RAID6) for a total of 4TB usable storage.