Why is my rsync transfer slow?

Simon Hobson linux at thehobsons.co.uk
Sat Feb 6 21:41:30 UTC 2016

dbonde+forum+rsync.lists.samba.org at gmail.com wrote:

> NAS <--ethernet--> computer <--FW800--> external disk
> The NAS can handle external USB drives and the external disk has USB2 so I could set it up like this
> external disk <--USB2--> NAS <--ethernet--> computer
> but I assumed it meant that I had to transfer the data from the external disk to the computer via both USB and ethernet and then transfer it back to the NAS over ethernet which, intutively, sounded slow.

Your intuition is correct - on two counts.
First off, USB2 is a lot slower than FW800 - it's often slower than FW400 even though on paper it's faster at 480Mbps. That's all down to the underlying architecture.
The extra trip over gigabit ethernet probably won't slow things down, however, the hosting of the drive via the NAS may well cause another bottleneck. For two reasons - firstly there's the hosting itself, and of course the load of hosting it adds to the load of hosting the destination drive.

dbonde+forum+rsync.lists.samba.org at gmail.com wrote:

> I scrapped all my previous progress and started over with a different "connection setup", now the NAS is connected to the computer using 1 Gbit wired ethernet, while the source disk is still using FW800.
> On bigger files I now typically get 20-30 MB/s so that was a substantial improvement.

That's still poor. That's only 160 to 240 Mbps - while you should easily get closer to 800 on large files.

TBH I'd be pointing my finger at the NAS and wondering about it's performance. Some makes/models have a reputation for rather crap performance, while others are much better.

I would suggest trying a couple of tests with a large file (or a small number of largish files) - at least several GB. Compare copying it with the finder, using cp in a terminal window, and using rsync. Repeat with a similar amount of data in small files. That should give an idea of raw throughput capacity, and how much overhead in file management slows things down.

> Mostly I still let this computer idle but when I use it it sometimes freezes in a way that reminds of how it feels when you use a computer that hasn't enough memory (it has 8 GB). Although, according to Activity Monitor, memory pressure is still green (used 6.5 GB, Cache 1.4 GB, Swap 10 GB).

Given those memory numbers, I'm not surprised you get pauses. I'm guessing your have 8G of real RAM, and it's up to 10G of swap. I have MenuMeters installed with a disk indicator - it's noticeable that under certain conditions the system gets "slow to respond" while the disk activity light is on solid (or nearly so). Swapping to/from disk is always very slow - several orders of magnitude slower than normal memory access.
When transferring large quantities of data, that tends to flush everything else from the cache - so as soon as you do anything needing disk access, your request has to go to disk (as it's not in cache) and it also goes onto a queue. That makes interactive work feel very slow - how it feels is out of proportion to the actual slowdown. I notice it when I'm doing backups - I use Retrospect and on large files it can reach something in the order of 500Mbps throughput overall, much much less with lots of smaller files when other overheads take over (not least, lots of disk head movement seeking each small file).

More information about the rsync mailing list