Performance Indicators: KVM vs. Xen

Original author: Major Hayden
  • Transfer

At Cloud4Y, we see VmWare as the leading virtualization solution. However, we are interested in other solutions, including Xen and KVM. And here is what we noticed: there is not so much information that allows us to compare these hypervisors: the latest practical studies that we found on the network date back to 2012 and, of course, can no longer be considered relevant. Today we will present to your attention also not the newest, but, in our opinion, quite useful research devoted to the performance of the KVM and Xen hypervisors.


image

Hypervisor KVM


Yes, the virtualization guru will forgive us, but first we’ll remind readers what a hypervisor is and why it is needed. To perform tasks of different meanings (software development, hosting , etc. ), it is easiest to use virtual machines: they will allow you to have several different operating systems with the appropriate software environment. For simplicity of working with virtual machines, hypervisors are used - software tools that allow you to quickly deploy, stop and start VMs. KVM is one of the most widespread hypervisors.


KVM is software that allows you to organize PC-based virtualization running Linux and similar. Recently, KVM is considered a component of the Linux kernel and is developing in parallel with it. This hypervisor can only be used in systems where virtualization is supported by hardware - using Intel and AMD processors.


In the process, KVM accesses the kernel directly through a processor-specific module ( kvm-intel or kvm-amd ). In addition, the main core - kvm.ko and UI elements, including the widespread QEMU, is included in the complex. KVM allows you to directly work with VM files and disk images. Each virtual machine is provided with its own isolated space.

Hypervisor Xen


Initially, Cambridge students launched a project that eventually became a commercial version of Xen. The first release is dated 2003, and in 2007, the source code was purchased by Citrix. Xen is a cross-platform hypervisor with great functionality and huge capabilities, which makes it possible to use it in the corporate field. Xen supports paravirtualization, a special kernel mode of the operating system when the kernel is configured to work simultaneously with the hypervisor.



Only the necessary set of functions has been added to the Xen code: managing virtual memory and processor clock speed, working with DMA, a real-time timer, and interrupts. The rest of the functionality is moved to domains, that is, to virtual machines that are running at that time. Thus, Xen is the lightest hypervisor.



The essence of the study


Testing is based on the use of two SuperMicro servers, each of which has a quad-core Intel Xeon E3-1220 processor with a clock frequency of 3.10 Hz, 24GB Kingston DDR3 RAM and four Western Digital RE-3 160GB (RAID 10) drivers . BIOS versions are identical.
For hosting and virtual machines, we took Fedora 20 (with SELinux). Here are the software versions we have taken:

  • Kernel: 3.14.8
  • For KVM: qemu-kvm 1.6.2
  • For Xen: xen 4.3.2

All root file systems are XFS with default configuration. Virtual machines are created using virt-Manager using the default settings applicable to KVM and Xen. Virtual disks used raw images and 8 GB of RAM was allocated with 4 vCPUs (virtual processors). OSs running on Xen used PVHVM.



Explanations


Some of you may begin to resent - they say that the owner of Fedora 20, Red Hat, spends a significant amount of effort supporting KVM. To clarify: Red Hat has not made significant progress in Xen for many years.


In addition, competition between hypervisors is tightly controlled and minimized. On most virtual servers, you will have several virtual machines fighting over CPU time, I / O devices and network access. Our testing does not take this into account. One hypervisor can have low productivity with low competition for resources, and then show much greater efficiency than competitors when the struggle for resources is higher.

The study was conducted on Intel processors, so its results may differ for AMD and ARM.

results


Tests for virtual machines installed directly on hardware, that is, without an operating system (hereinafter referred to as hardware), served as the basis for testing virtual machines. The performance deviation between the two servers without virtualization was 0.51% or less.


KVM performance fell within 1.5% compared to hardware in almost all tests. Only two tests showed a different result: one of them is the 7-Zip test , where KVM showed itself 2.79% slower than hardware. It is strange that KVM was 4.11% faster in the PostMark test (which simulated a heavily loaded mail server). The performance of Xen was much different from the performance of hardware than in the situation with KVM. In three tests, Xen differed by 2.5% from the speed of hardware, in other tests it turned out to be even slower.

In the PostMark test, Xen was 14.41% slower than hardware. When restarting, the test results differed from the initial ones by 2%. The best test for KVM, MAFFT, was second on the list of worst for Xen.

Here is a short test result:
Best valueBare metalKvm Xen
Timed MAFFT Alignmentlower 7.787.7958.42
Smallpt lower 160 162 167.5
Pov ray lower 230.02 232.44 235.89
Postmark higher 3667 3824 3205
Openssl higher 397.68 393.95 388.25
John the Ripper (MD5) higher 49548 48899.5 46653.5
John the Ripper (DES) higher 7374833.5 7271833.5 6911167
John the Ripper (Blowfish) higher 3026 2991.5 2856
CLOMP higher 3.3 3.285 3.125
C ray lower 35.35 35.66 36.13
7-zip higher 12467.5 12129.5 11879

If you want to see the full results, follow the  link .



Instead of a conclusion


In our testing, KVM was almost always 2% slower than hardware. Xen was 2.5% slower in three out of ten tests, and worse in the rest: by 5-7%. Although KVM showed its best in the PostMark test, it should be noted that we conducted only one I / O test, and to get a more reliable picture, it’s worth a few more.


To select the right hypervisor, you must correctly evaluate the nature of your workloads. If your workloads require less CPU and more I / O, then you can do more I / O tests. If you work mainly with audio and video, try the x264 or mp3 tests.

[UPD] As mister_fog rightly pointed out , in 2007 Citrix bought not Xen source code, but XenSource, which was founded by Xen developers and was engaged in the commercial development of this open source project. Proof .

Also popular now: