Debian PVHVM vs PV

Nov 8, 2013

This time, it's not a news about Xen Orchestra, but a benchmark of virtualization modes: PVHVM vs PV. When I saw the numbers from Rackspace, well... I choose to do my own tests here, despite it's in other context (small test lab). We'll (re)explain concepts first, then our test protocol and at least the results.

PV, HVM and PVHVM

  • PV (Paravirtualization) is an original Xen concept, allowing running modified kernel in virtual machines to provide better performances than traditional way. Your virtualized OS "knows" it's running on a hypervisor, and makes call (I/O, network...) without a additional layer (he "talks" directly to the Hypervisor). That's why it will work on hardware which doesn't have any virtualization extensions (like Intel VT or AMD-V). More details can be found on this page.
  • HVM (Hardware Assisted Virtualization) is more a "traditional" way: Xen use Qemu to emulate PC hardware but extensions will boost performances. The good news is you doesn't need any modified kernel/OS: it doesn't know the presence of an hypervisor under. The "bad" is the hardware needed and the performance impact on I/O and Network load, because of this additional emulation layer
  • PVHVM is basically an HVM guest with special drivers for disks and network: those drivers are known as "GPLPV" on Windows, and are included in Linux for 2.6.36+ kernels (details here). And yes, Debian 7 (Wheezy) default kernel is compiled with those drivers. So if you install a Debian 7 in HVM mode, you are running PVHVM out of the box! More details on PVHVM perfs and architecture here.
  • PV in an HVM Container (PVH) : wait... what?? Ok, it's a surprise: PVH will be another virt mode possible in Xen 4.4. The main difference is the "order" of mode: in PVHVM, you have PV driver IN a HVM guest. This time, it will brings hardware extensions IN a PV guest. So you'll boot a classical PV virtual machine and then uses extensions when it can. No more emulation and possibly the best combination possible. Sadly, I can't test it now, be don't forget this PVH mode, you'll probably heard about it next year.

XenServer and PV or HVM

It's not complicated to create PV or HVM Debian (or derived) guest in XenServer: if you install a VM with its associated template, it will be by default a PV guest. For an HVM guest, you'll use "Other install media".

That's all! If you want to know in which mode you are, here is the tip for Debian: go in /etc/default/grub and put "GRUB_CMDLINE_LINUX=loglevel=9". Reboot it, and read the dmesg output, you shall read something like:

Netfront and the Xen platform PCI driver have been compiled for this kernel

Benchmarks

This is the first run with UnixBench, more bench will come with I/O and network soon. Our test platform consist of:

  • i5-3470 CPU @ 3.20GHz (4 cores and Intel VT) with 8GB RAM on XenServer 6.2
  • iSCSI storage on Nexenta Community, 2TB with SSD L2ARC cache
  • Debian 7 guests, with 4 cores, 2GB RAM and 20GB of HDD.

All benchmarks are done after a fresh install.

UnixBench

Two modes are used for UnixBench (in fact the default mode, started by ./Run) : first is a single test pass and the next one is a 4 parallel copies of tests.

unixbench1

unixbench8

Those results are totally coherent with the original benchmark, done by Rackspace.

UnixBench running in Debian PVHVM mode offers respectively 205% and 128% performance boost over PV. In other words, UnixBench says that Debian in PVHVM is 2 or 3 times faster than Debian PV.

Kernel compilation time

kernel_time

This time, in "real" condition, a Kernel compilation, we saw that PVHVM can do the task 15% faster. Not bad!

FIO

fio1

fio2

We can tell that PVHVM brings a clear bonus in Random Read configuration (+16% than PV), which is pretty consistent to the Kernel compilation time benchmark. In Random Write, it's very close (+5% max).

Not displayed here but also important, the latency were slightly reduced on PVHVM guest (14% faster in r-read and 4% in r-rwrite). CPU load is also a bit lower: only good news here!

Phoronix Test Suite

Very convenient for our case, PTS provides a "turnkey" solution for benchmarking Unix hosts. Let's see different use cases. All benchmarks are available here.

p1

7-Zip compression doesn't seem to be impacted by PVHVM mode.

p2

But it's not the same for SQLite database! PVHVM is 15% faster than PV.

p3

Apache is also faster (~14% faster in PVHVM)

p4

OpenSSL benchmark indicates absolutely no performance boost.

p5

PHP gets a small performance augmentation in PVHVM (5%).

Conclusion

PVHVM Debian Xen guests running modern hardware are faster than "classical" PV.  And as Debian embed in its current kernel all the needed drivers (PVHVM work out of the box), you can get more performance for your current Xen or XenServer infrastructure for a small cost.

Olivier Lambert

Vates CEO & co-founder, Xen Orchestra and XCP-ng project creator. Enthusiast entrepreneur and Open Source advocate. A very happy Finnish Lapphund owner.