On Sun, Aug 22, 2010 at 10:31:55PM +0300, Avi Kivity wrote:
On 08/22/2010 10:02 PM, Richard W.M. Jones wrote:
Interesting, I'd have guessed that encryption will dominate the cpu cost, and that compression would be a win since there's less to encrypt and transmit.
Maybe my explanation is wrong too. virt-p2v was definitely much slower when we added the '-C' option. However read on.
I just ran a test again on my local LAN. This is between two approximately equal Fedora machines, over a moderate quality consumer gigabit ethernet switch. The command approximates what virt-p2v does: sending 1MB blocks from local /dev device, and at the target end using cat to write to a file.
$ time sh -c 'dd bs=1M if=/dev/vg_trick/Windows7x64 | ssh amd "cat> /tmp/copy1"' 16384+0 records in 16384+0 records out 17179869184 bytes (17 GB) copied, 1473.26 s, 11.7 MB/s
real 24m33.269s user 4m16.944s sys 4m43.181s
11.7 MB/s = 93.6 Mb/s. Not the cpu is not loaded. Are you sure you're using 1GbE here?
You're absolutely right -- I forget that it's a fast ethernet switch :-)
$ time sh -c 'dd bs=1M if=/dev/vg_trick/Windows7x64 | ssh -C amd "cat> /tmp/copy2"' 16384+0 records in 16384+0 records out 17179869184 bytes (17 GB) copied, 1412.7 s, 12.2 MB/s
real 23m32.736s user 17m52.739s sys 5m0.884s
Suddenly you're cpu bound. So it looks like compression is really expensive for some reason.
Rich.