Virt-io Networking

I have already been using virt-io for hard-disk emulation in my guest machines under KVM. However, I have never tried virt-io networking before. Seeing that I wanted to upgrade my machines, I thought that I’d give it a try and this is where I noticed the speed bump.

Following some of the instructions at the lib-virt page, I got virt-io networking working for all my VMs. This is the result:


------------------------------------------------------------
Client connecting to x.x.x.x, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 3] local x.x.x.x port 34610 connected with x.x.x.x port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 113 MBytes 94.4 Mbits/sec
[ 3] 10.0-20.0 sec 116 MBytes 97.3 Mbits/sec
[ 3] 20.0-30.0 sec 117 MBytes 97.8 Mbits/sec
[ 3] 30.0-40.0 sec 115 MBytes 96.8 Mbits/sec
[ 3] 40.0-50.0 sec 115 MBytes 96.4 Mbits/sec
[ 3] 50.0-60.0 sec 116 MBytes 97.7 Mbits/sec
[ 3] 60.0-70.0 sec 117 MBytes 97.9 Mbits/sec
[ 3] 70.0-80.0 sec 116 MBytes 97.6 Mbits/sec
[ 3] 80.0-90.0 sec 115 MBytes 96.3 Mbits/sec
[ 3] 90.0-100.0 sec 117 MBytes 98.0 Mbits/sec
[ 3] 0.0-100.0 sec 1.13 GBytes 97.0 Mbits/sec
virt-io activated.


------------------------------------------------------------
Client connecting to x.x.x.x, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 3] local x.x.x.x port 58218 connected with x.x.x.x port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 47.6 MBytes 39.9 Mbits/sec
[ 3] 10.0-20.0 sec 49.7 MBytes 41.7 Mbits/sec
[ 3] 20.0-30.0 sec 46.5 MBytes 39.0 Mbits/sec
[ 3] 30.0-40.0 sec 50.8 MBytes 42.6 Mbits/sec
[ 3] 40.0-50.0 sec 49.5 MBytes 41.5 Mbits/sec
[ 3] 50.0-60.0 sec 47.5 MBytes 39.8 Mbits/sec
[ 3] 60.0-70.0 sec 44.9 MBytes 37.6 Mbits/sec
[ 3] 70.0-80.0 sec 46.1 MBytes 38.7 Mbits/sec
[ 3] 80.0-90.0 sec 45.2 MBytes 37.9 Mbits/sec
[ 3] 90.0-100.0 sec 46.2 MBytes 38.8 Mbits/sec
[ 3] 0.0-100.0 sec 474 MBytes 39.8 Mbits/sec
virt-io deactivated.

As you can see, more than a 200% increase in through-put.

What is more amazing is that this increased bandwidth is not shared directly. This means that two guest VMs running under the same host both enjoy a 100Mbps speed simultaneously, not 100Mbps shared across the two. This is a massive performance boost, especially inter-VM.

Lesson learned – ALWAYS use virt-io for all I/O operations under KVM/libvirt.

Advertisements

Published by

Shawn Tan

Chip Doctor, Chartered Engineer, Entrepreneur, Law Graduate.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s