Shipping around lots of small files

Shipping around small files sucks. SCP takes forever and a day. Tossing them into a tarball and sending them over would take just as much time in total. Courtesy of Brian McCallister:

On the destination machine: nc -vl 9000 | cpio -id

And on the source machine: find ./my/data/lives/here | cpio -o | nc -v destination.blah.com 9000

Significantly faster. I clocked scp at 628k/sec and cpio/nc at 2183k/sec. Machines are on the same subnet. Screwing with the block size in cpio might result in better performance.

Sunday, January 6, 2008