📜 ⬆️ ⬇️

Performance Indicators: KVM vs. Xen

We at Cloud4Y consider VmWare products as the leading virtualization solution. However, we are interested in other solutions, including Xen and KVM. And here's what we noticed: there is not too much information to compare these hypervisors: the last good research that we found on the network relates to 2012 and, of course, can no longer be considered relevant. Today we will present to your attention not the newest, but, in our opinion, quite a useful study on the performance of KVM and Xen hypervisors.


image

KVM hypervisor


Forgive us virtualization gurus, but first we remind readers what a hypervisor is and what it is for. To perform various tasks (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 ease 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 widely distributed hypervisors.


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


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

Xen hypervisor


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



The Xen code added only the necessary set of functions: management of virtual memory and processor clock frequency, work with DMA, real-time timer and interrupts. The rest of the functionality is rendered to the domains, that is, to the virtual machines running at that time. Thus, Xen is the easiest hypervisor.


')

The essence of the study


Testing is based on the use of two SuperMicro servers, each with 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 drivers 160GB (RAID 10). BIOS versions are identical.
For hosting and virtual machines we took Fedora 20 (with SELinux). Here are the software versions we took:


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



Explanations


Some of you may be outraged - they say, the owner of Fedora 20, Red Hat, spends a significant amount of effort on supporting KVM. To clarify: Red Hat has not made significant progress on the Xen part for many years.


In addition, the competition between hypervisors is tightly controlled and minimized. On most virtual servers, you will have several virtual machines competing for processor time, I / O devices, and network access. Our testing does not take this into account. One hypervisor may have low performance with low competition for resources, and then show far more efficiency than competitors when the fight 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 penalty between the two servers without virtualization was 0.51% or less.


KVM performance fell within 1.5% compared to the “iron” in almost all tests. Only two tests showed a different result: one of them was the 7-Zip test, where KVM showed itself by 2.79% slower than the "iron". 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 more different from the performance of "iron" than in the situation with KVM. In the three tests, Xen differed by 2.5% from the speed of the "iron", in the rest of the tests it was even slower.

In the PostMark test, the Xen was 14.41% slower than the hardware. At restart, the test results differed from the initial by 2%. The best test for KVM, MAFFT, turned out to be the second worst in the list for Xen.

Here is a brief summary of the test:
Best ValueBare metalKVMXen
Timed MAFFT Alignmentlower7.787.7958.42
Smallptlower160162167.5
Pov raylower230.02232.44235.89
Postmarkhigher366738243205
Opensslhigher397.68393.95388.25
John the Ripper (MD5)higher4954848899.546653.5
John the Ripper (DES)higher7374833.57271833.56911167
John the Ripper (Blowfish)higher30262991.52856
CLOMPhigher3.33.2853.125
C-raylower35.3535.6636.13
7-ziphigher12467.512129.511879

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



Instead of conclusion


In our testing, KVM was almost always 2% slower than hardware. Xen was 2.5% slower in three tests out of ten, and the rest even worse: 5-7%. Although KVM showed itself best in the PostMark test, it should be noted that we performed only one I / O test, and it is worthwhile to conduct a few more for a more reliable picture.


To select the right hypervisor, you need to correctly assess the nature of your workloads. If your workloads require less CPU power and more I / O, then you can run more I / O tests. If you work mostly with audio and video, try x264 or mp3 tests.

[UPD] As mister_fog rightly noted, 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

Source: https://habr.com/ru/post/282918/


All Articles