https://linux-kvm.org/index.php?title=Using_VirtIO_NIC&feed=atom&action=historyUsing VirtIO NIC - Revision history2024-03-28T09:35:31ZRevision history for this page on the wikiMediaWiki 1.39.5https://linux-kvm.org/index.php?title=Using_VirtIO_NIC&diff=1836&oldid=prevWikiSysop at 13:44, 4 February 20092009-02-04T13:44:53Z<p></p>
<p><b>New page</b></p><div>= Using virtio_net For The Guest NIC = <br />
The following is done using Debian Lenny, with the 2.6.25 kernel installed from Sid.<br />
* install the guest OS as per normal, using rtl8139 or e1000 for the guest NIC <br />
* boot into the guest as per normal <br />
* edit /etc/apt/sources.list to add a sid repo <br />
* install the 2.6.25 kernel <br />
* boot into the guest using the 2.6.25 kernel <br />
* edit /etc/initramfs-tools/modules and add '''virtio''', '''virtio_pci''', '''virtio_ring''', '''virtio_net''', '''virtio_blk''' <br />
* update the initramfs using '''update-initramfs -u''' <br />
* shutdown the guest <br />
* change the '''-net nic''' option to include '''model=virtio''' <br />
* boot the guest <br />
<br />
= Throughput Tests Using iperf =<br />
To see what the throughput differences would be like, I ran a bunch of iperf tests from a Debian guest.<br />
<br />
== Host Server Config ==<br />
* Tyan h2000M motherboard<br />
* 2x dual-core Opteron 2220 CPUs @ 2.8 GHz<br />
* 8 GB DDR2-667 ECC SDRAM (2x 2 GB sticks per CPU)<br />
* 3Ware 9650SE-16ML SATA-II RAID Controller <br />
* 12x 500 GB SATA-II harddrives in a single RAID-6 array<br />
* Intel PRO/1000-MT PCIe quad-port gigabit NIC (configured as 4-port bond0, used as the kvm bridge)<br />
* Debian Lenny installed, updated June 04, 2008, with kvm-69 and kernel 2.6.25 (kernel from Sid) <br />
<br />
== Guest VM Config ==<br />
* 1 CPU <br />
* 2 GB RAM <br />
* 100 GB virtual harddrive (via LVM)<br />
* Debian Lenny with kernel 2.6.25 from Sid<br />
* /usr/bin/kvm -name mail -daemonize -localtime -usb -usbdevice tablet -smp 1 -m 1048 -vnc :04 -pidfile /var/run/kvm/mail.pid -net nic,macaddr=00:16:3e:00:00:04,model=virtio -net tap,ifname=tap04 -boot c -drive index=0,media=disk,if=virtio,boot=on,file=/dev/mapper/vol0-mail<br />
<br />
== iperf Server Config ==<br />
* iperf -s -w 65536 -p 12345 -I 5<br />
<br />
== iperf Client Configs ==<br />
* [1] iperf -c <server> -w 65536 -p 12345 -t 60<br />
* [2] iperf -c <server> -w 65536 -p 12345 -t 60 -d<br />
* [3] iperf -c <server> -w 65536 -p 12345 -t 60 -P 4<br />
<br />
== Results ==<br />
These are averaged over 3 runs.<br />
<br />
To the host (virtio)<br />
* [1] 92 Mbps<br />
<br />
To a server connected to a gigabit port on the same switch (virtio)<br />
* [1] 834 Mbps<br />
* [2] 519 Mbps out, 531 Mbps in<br />
* [3] 906 Mbps combined<br />
<br />
To a server connected to a gigabit port on the same switch (e1000)<br />
* [1] 296 Mbps<br />
* [2] 259 Mbps out, 62 Mbps in<br />
* [3] 302 Mbps combined</div>WikiSysop