I am copying files from one USB SATA drive to another connected to a Mac Pro via USB 3. Rsync should be able to copy approaching 100 MB/second, but it never copies anywhere near this speed and for a few files, it's so slow as to almost be stalled, averaging near 131KB/second. The OS is Mac OS 10.13.6 and the rsync is provided via homebrew.
The command being used is as follows
/usr/local/bin/rsync --acls --archive --delete --exclude-from=/usr/local/etc/backupignore --sparse --verbose --progress --xattrs /Volumes/externalhd/ /Volumes/backuphd/external/
The sparse option is triggering this slowness. Without it, rsync runs super fast.
I should also mention the file being copied so slowly is a Virtualbox virtual disk file.
what is the source and what is the remote filesystem ?
what does iostat tell on the source and the destination?
what's the size of the sparse files and how much of data is "inside" ?
How about using truss/strace/whatever the OSX equivalent is to get a count of all system calls made, when run with and without the --sparse option. Total time on each type of call would be useful too.
If you find that --sparse results in ten times as many write(2)s, that might be a useful clue!
BTW remember there is a bug that is triggered by using --sparse and --preallocate (and possibly --inplace) together. See https://bugzilla.samba.org/show_bug.cgi?id=13320#c1 for details.