[Discuss] rsync v. cp in data migration

Edward Ned Harvey (blu) blu at nedharvey.com
Sat May 25 09:54:49 EDT 2013


> From: discuss-bounces+blu=nedharvey.com at blu.org [mailto:discuss-
> bounces+blu=nedharvey.com at blu.org] On Behalf Of Edward Ned Harvey
> 
> Ah - Agreed - but there's a distinction to make here.  "rsync" the application,
> versus "rsync" the protocol.  You can use the rsync application from local disk

Another performance optimization to consider:  With a local Gbit network, you're likely to get the best performance if you use rsync protocol, and disable rsync protocol.    ;-)   

I'm being funny, but serious.  The first thing rsync protocol is going to do is look at basic file statistics (time, size, etc), and transmit these stats across the wire for comparison.  But then when a changed file has been identified, depending on the options you pass to rsync, it may try to calculate and only send the diff across the wire.  This requires both sides to locally read the whole file, while communicating checksums or something to each other, calculate the diffs, and then send the diffs.  If you have a sufficiently slow network, and sufficiently small size of diff relative to the whole file, that calculation is enormously worth while.  But if you have a sufficiently fast network, you could use --whole-file to unconditionally send the whole file, faster than the two sides can calculate and communicate the diff.



More information about the Discuss mailing list