Speed Comparison Xen, KVM and VirtualBox
Quote from a variety of popular sources:
Based on general performance trends for these virtualization technologies, here’s how they compare to the native system for a typical mixed workload (combining CPU and I/O operations):
Xen: Xen runs at approximately 98% of the native system’s speed. This means it is about 2% slower due to the minimal overhead introduced by its virtualization layer. Its efficiency stems from running directly on the hardware and supporting features like paravirtualization for optimized I/O. KVM: KVM operates at about 99% of the native system’s speed, making it approximately 1% slower than the native system. Its slight edge over Xen comes from its tight integration with the Linux kernel and the use of virtio drivers for efficient I/O handling, bringing it very close to native performance. VirtualBox: VirtualBox performs at around 95% of the native system’s speed, meaning it is approximately 5% slower than the native system. As a type 2 hypervisor, it incurs additional overhead because it runs on top of a host OS, though hardware virtualization extensions and paravirtualization options help mitigate this to some extent.
Key Notes
These percentages are approximate and reflect general performance for a balanced workload. Actual speeds can vary depending on: Workload Type: CPU-intensive tasks may show all three hypervisors closer to 99% of native speed, while I/O-intensive tasks might widen the gap, especially for VirtualBox (potentially dropping to 90% or lower). Configuration: Optimizations like enabling hardware virtualization (e.g., Intel VT-x or AMD-V) or using paravirtualization can improve performance. KVM tends to have the least overhead, followed closely by Xen, with VirtualBox trailing slightly due to its type 2 nature.
Summary
In relation to the native system:
Xen: 98% (2% slower) KVM: 99% (1% slower) VirtualBox: 95% (5% slower)
This comparison provides a clear picture of their relative performance, with KVM being the closest to native speed, Xen very slightly behind, and VirtualBox a bit further due to its additional layer of abstraction.
I decided to test this data for Qubes running Xen using the ‘7z b’ test.
First, I installed a clean Debian on my computer and measured the speed.
It turned out to be 16929 MIPS:
Let’s take it as 100%.
Then I installed VirtualBox, virtual Debian in it and measured the speed again.
It turned out to be 11268 MIPS:
VirtualBox, this is 67%, which is much less than the promised 95%.
After that I installed Qubes on the same computer and measured the speed in Debian AppVM.
The speed was 11895 MIPS:
Xen on Qubes. this speed is 70% of the natural speed, i.e. 30% less than the expected speed of Xen.