http://www.ilsistemista.net/index.php/virtualization/42-kvm-virtio-paravirtualized-drivers-why-they-matter.html?limitstart=0

As you probably already know, there are basically two different schools in the virtualiztion champ:

  • the para-virtualization one, where a modified guest OS uses specific host-side syscall (hypercall) to do its “dirty work” with physical devices
  • the full hardware virtualization one (HVM), where the guest OS run unmodified and the host system “traps” when the guest try to access a physical device

The two approach are vastly different: the former requires extensive kernel modifications on both guest and host OSes but give you maximum performance, as both kernels are virtualization-aware and so they are optimized for the typical workload they experience. The latter approach is totally transparent to the guest OS and often do not require many kernel-level changes to the host side but, as the guest OS is not virtualization aware, it generally has lower performance.

So it appear that you had to do a conscious choice between performance and guest OS compatibility: the paravirtualized approach prioritize performance, while the HVM one prioritize compatibility. However, in this case it is possible to have the best of both worlds: by using para-virtualized guest device driver in an otherwise HVM environment, you can have compatibility and performance.

In short, a paravirtualizad device driver is a limited, targeted form of paravirtualization, useful when running specific guest OSes for which paravirtualization drivers are available. While being largely transparent to the guest OS (you simply need to install a driver), they relieve the virtualizer from emulating a real physical device (which is a complex operation, as it must emulate register, port, memory, ecc), substituting the emulation with some host-side syscall. The KVM-based framework to write paravirtualized drivers is called VirtIO.

Things are much more complex than this, of course. Anyway, in this article I am not going to explain in detail how a paravirtualized driver works, but to measure the performance implication of using it. Being a targeted paravirtualization form requiring guest-specific drivers, it is obvious that VirtIO is restricted to areas where it matter most, so disk and network subsystems are prime candidates for those paravirtualized drivers. Let see if, and how, both Linux (CentOS 6 x86-64) and Windows (Win2012R2 x64) are affected from that paravirtualized goodness.

Testbed and methods

All test run on a Dell D620 laptop. The complete system specifications are:

  • Core2 T7200 CPU @ 2.0 GHz
  • 4 GB of DDR2-667 RAM
  • Quadro NVS110 videocard (used in text-only mode)
  • a Seagate ST980825AS 7200 RPM 80 GB SATA hard disk drive (in IDE compatibility mode, as the D620's BIOS does not support AHCI operation)
  • CentOS 6.5 host-side OS with kernel version 2.6.32-431.1.2.0.1.el6.x86_64
  • a 512 MB ramdisk driver used for disk speed measurements

On the guest side, we have:

  • a first CentOS 6.5 guest (kernel version 2.6.32-431.1.2.0.1.el6.x86_64)
  • a second Windows 2012 R2 x64 virtual machine

The VirtIO paravirtualized drivers are already included in the standard Linux kernel, so for the CentOS guest no special action or installation was needed. On the Windows guest, I installed the VirtIO disk and network drivers from the virtio-0.1-74.iso package.

For quick disk benchmark, I used dd on the Linux side and ATTO on the Windows one. To pose additional strain on guest disk subsystem and the host virtualizer, I run all disk tests against a ramdisk drive: in this manner I was sure that eventual differences were not masked out by the slow mechanical disk. Networking speed was measured with the same tool on both VMs: iperf, version 2.0.5.

Host CPU load was measured using mpstat.

Ok, let see the numbers...

CentOS 6 x86-64 guest

The first graph shows CentOS 6 guest disk speed with and without the paravirtualized driver:

Native performances are included for reference only. We can see that para-virtualized disk driver provide a good speedup versus the standard virtualized IDE controller. Anyway, both approaches are far behind the native scores.

Net speed now:

In this case the paravirtualized network driver makes an huge difference: while it can't touch native speed, it is way ahead of the virtualized E1000 NIC adapter. The RTL8139 was benchmarked for pure curiosity, and it show a strange behavior: while output speed is in line with NIC speed (100 Mb/s), input speed is much higher (~400 Mb/s). Strange, but true.

While host CPU load is lower on the full virtualized NICs, it is only because they deliver much lower performance. In other word, the Mb/s per CPU load ratio is much higher on the para virtualized network driver.

Windows 2012 R2 x64 guest

Let see if Windows guest has some surprise for us. Disk benchmark first:

This time, the fully virtualized IDE driver is much behind the para-virtualized driver. In other word: always install the paravirtualized driver when dealing with Windows guests.

Network, please:

The paravirtualized driver continues to be much better then the fully virtualized NICs.

Conclusions

It is obvious that the paravirtualized drivers are an important piece of the KVM ecosystem. While the fully virtualized drivers are quite efficient and the only way to support a large variety of guest OSes, you should really use a paravirtualized driver if available for your guest virtual machine.

Obviously performance are only part of the equation, stability being even more important. Anyway I found the current VirtIO drivers release very stable, at least with the tested guests.

In short: when possible, use the VirtIO paravirtualized drivers!

[转] KVM VirtIO paravirtualized drivers: why they matter的更多相关文章

  1. [Virtualization][qemu][kvm][virtio] 使用 QEMU/KVM 模拟网卡多队列

    序: 做DPDK例子的时候,发现一些例子需要多队列,而我当前所使用的虚拟机并不是多队列的.关于我当前虚拟机的状态,可以见前文. 所以,我的需求就是,让虚拟机里的网卡,有多队列! 参考: http:// ...

  2. 别以为真懂Openstack: 虚拟机创建的50个步骤和100个知识点(4)

    六.Libvirt 对于Libvirt,在启动虚拟机之前,首先需要define虚拟机,是一个XML格式的文件 列出所有的Instance # virsh list Id    Name         ...

  3. KVM: 安装Windows virtio半虚拟化驱动

    Install KVM Windows virtio para-virtualized dirver If you can't read Chinese, there's an English ver ...

  4. virtio 半虚拟化驱动

    半虚拟化驱动 5.1.1 virtio概述 KVM是必须使用硬件虚拟化辅助技术(如Intel VT-x.AMD-V)的hypervisor,在CPU运行效率方面有硬件支持,其效率是比较高的:在有Int ...

  5. Virtio: An I/O virtualization framework for Linux

    The Linux kernel supports a variety of virtualization schemes, and that's likely to grow as virtuali ...

  6. [转] KVM I/O slowness on RHEL 6

    KVM I/O slowness on RHEL 6 http://www.ilsistemista.net/index.php/virtualization/11-kvm-io-slowness-o ...

  7. VIRTIO概述和基本原理

    http://smilejay.com/2012/11/virtio-overview/ (KVM连载)5.1.1 VIRTIO概述和基本原理(KVM半虚拟化驱动) 11/15/2012MASTER  ...

  8. ubuntu14.04 desktop 32-bit kvm装windows xp

    经过这几天来的折腾,总算是在ubuntu14.04用kvm装上了xp, 看不少的的贴,也绕了不少的圈,总的来说,非常感谢CSDN上的"上善若水75",看着他写的一个分类" ...

  9. [原] KVM 虚拟化原理探究(5)— 网络IO虚拟化

    KVM 虚拟化原理探究(5)- 网络IO虚拟化 标签(空格分隔): KVM IO 虚拟化简介 前面的文章介绍了KVM的启动过程,CPU虚拟化,内存虚拟化原理.作为一个完整的风诺依曼计算机系统,必然有输 ...

随机推荐

  1. shell脚本简介

    什么是shell? shell是一个命令解释器,它在操作系统的最外层,负责直接与用户对话,把用户的输入解释给操作系统,并处理各种各样的操作系统的输出结果,输出到屏幕返回给用户.这种对话方式可以是交互的 ...

  2. 好用的.NET控制台测试项目

    在工作和学习上,我们经常需要创建项目,引用些其他的库,测试下自己的想法是否正确,需要捕捉一下异常.调用一下异步方法.记录一下log等等,这样的项目都是需要花费时间,为了较少花费的时间,产生了一个这样的 ...

  3. MySQL 的几种进入方式

    对于码农一族来说,新入手电脑后,工具安装,环境搭建是为必备功课.环境搭不好工具装不全,后续的工作开展那就会有相当多的痛点,也会耗去相当多的时间和精力.近日,博主在安装 Mysql 数据库的过程中,一番 ...

  4. python 打开浏览器的方法 Python打开默认浏览器

    一.python 打开浏览器的方法: . startfile方法(打开指定浏览器) import os os.startfile("C:\Program Files\internet exp ...

  5. SpringMVC 使用PUT请求遇到的问题小结

    最近在使用REST风格的URL进行CURD操作的学习过程中 发现使用PUT请求时候提交表单进行修改操作 报错:Request method 'PUT' not supported 在网上查找资料发现是 ...

  6. 7F - 无限的路

    甜甜从小就喜欢画图画,最近他买了一支智能画笔,由于刚刚接触,所以甜甜只会用它来画直线,于是他就在平面直角坐标系中画出如下的图形: 甜甜的好朋友蜜蜜发现上面的图还是有点规则的,于是他问甜甜:在你画的图中 ...

  7. localhost换成127.0.0.1和本机IP打不开本地项目了的问题

    点击桌面右下角的小三角, iis express右键—>显示所有应用程序—>点击网站名称,配置文件路径,找到配置文件,以记事本打开, 按照configuration--system.app ...

  8. vue+elementUI表格列显示隐藏遇到bug

    在最近的项目中,有需求要做到根据字段显示列,原来以为简单的v-if可以解决. 在开发的过程中遇到问题, <el-table ref="multipleTable" :data ...

  9. 解决Spark On Yarn yarn-cluster模式下的No Suitable Driver问题

    Spark版本:2.2.0_2.11 我们在项目中通过Spark SQL JDBC连接MySQL,在启动Driver/Executor执行的时候都碰到了这个问题.网上解决方案我们全部都试过了,奉上我们 ...

  10. Linux 安装源码软件

    linux下,源码的安装一般由3个步骤组成:配置(configure).编译(make).安装(make install) 过程中用到configure --prefix  --with:其中--pr ...