[Discuss] rsync v. cp in data migration

Richard Pieri richard.pieri at gmail.com
Thu May 23 20:11:02 EDT 2013


Tom Metro wrote:
> even be possible that the pauses cp takes to refill its buffers results
> in it saturating your I/O bandwidth less, which could be desirable if
> you are running this job while the disks are in use.)

Generic cp(1) tries to mmap a complete file into RAM (with a hard-coded
segment size limit). It then writes out the whole file (or segment) in
one go. This leads to massive memory thrashing when lots of small files
are being copied in sequence.

tar and cpio use fixed buffers (at least they should) so they can avoid
the mmap create/destroy cycles that a recursive cp provokes.

-- 
Rich P.



More information about the Discuss mailing list