Hypervisor Choice. Xen or KVM?
Which hypervisor is best for your cloud: Xen or KVM? It’s one the questions guaranteed to come up in conversations with new OnApp customers, as well as with existing clients.
In this blog, I wanted to provide more detail on the two open source hypervisors supported in the OnApp cloud management platform, and the use cases for them (we also support VMware, of course, but that’s a topic for another post).
In future posts I’ll follow up with more insights, such as the history of Xen and KVM, benchmarks, and views on new updates that come along. But first, let’s get back to the question: Xen or KVM?
The Xen Project began around 2004 at a time where there was no existing open source virtualization. Outside of containers (FreeBSD Jail, Virtuozzo, Solaris Jails), this kind of thing really didn’t exist.
There were some really nice scalability advantages to using a Jail/Container – but there were inherent weaknesses that prevented further innovation.
Here enters Xen, which is a Type I Hypervisor – which means it sits a single layer above bare metal. It’s like a stripped down operating system, and it uses a function called “pass-through” to connect directly to PCI devices like RAM/CPU/NICs.
KVM (Kernel-based Virtual Machine) was originally written by an Israeli software developer called Avi Kivity, while he was working at a company called Qumranet – which was acquired by Red Hat in $2008, for the princely sum of $107 million.
KVM is a Type II Hypervisor, which means that it is one layer above the OS. So you have a bare metal machine, install an OS, and THEN install KVM. In Linux it is installed in the form of a Kernel, and this kernel then turns the bare metal machine into a Hypervisor.
Which is best?
So, what’s the big deal? Aren’t they basically the same? Well, not really.
Yes, they are both open source, and both supported by large communities and large enterprises. And yes, they both do the fundamental job of virtualization. The differences are found in support for innovation, and in application integration, application awareness and performance.
Xen tends to be more stable. It is older, is more mature and offers near native drivers for OSs like Microsoft Windows, whereas KVM is weaker in those regards. However, KVM does very well when you compare Linux vs Linux against Xen.
From 2010 to about 2014, all we heard from OnApp customers was Xen, Xen Xen. No one wanted to touch KVM, but because Red Hat put its muscle into development, the fledgling new virtualization method has enjoyed much more success in the last couple of years, and is growing pretty fast.
Until 2014, very few people had the confidence to use KVM as a real-world solution. Today, I rarely hear the Xen-only mantra from customers.
If you’re pushing a lot of Linux-based solutions, I’d go with KVM. This doesn’t mean Xen is bad. It’s just that chances are, you’ll find KVM will offer better performance with the Linux OS. Ballooning works FAR better on KVM then Xen, which is why our Xen users don’t use this function – as Xen takes unused RAM from another VM and tends NOT return it afterwards*.
If you sell a lot of Windows-based cloud servers, there are probably more advantages to hosting on Xen because of the near native drivers.
In future blogs, I hope to provide some benchmarks to illustrate some of these performance differences. Click to learn more about the OnApp cloud management platform!
* Since posting this blog I’ve had lots of interest in this topic, and quite a few questions… so I’d just like to clarify a couple of points. First, this blog is an objective look at Xen and KVM, detailing what I have come across personally from speaking to OnApp customers, other cloud specialists and ISPs. And second, on the ballooning issue: OnApp chose not to include ballooning with Xen, as the function didn’t work well enough to warrant its integration. My blog implied that we do include it for Xen – apologies for that. I’ve edited it accordingly. Thanks!