Xen vs. VirtualBox under heavy load

performancevirtualboxvirtualizationxen

Which performs better under heavy CPU and memory usage on the virtual servers, Xen or VirtualBox?

Best Answer

Xen will generally perform much better than VirtualBox because VirtualBox runs the guest OS in a way that the guest OS does not know it is running in a virtual environment. Or to put it another way, the guest OS is not modified to run virtually. Because of this, VirtualBox has to 'trap' kernel type instructions, run some custom code and then return control to the guest. It can use the hardware virtualisation support provided by Intel and AMD, but even then the overhead adds up.

Xen meanwhile makes sure the guest OS is recompiled to fit in with the Xen model. So control flows smoothly from the guest OS to the hypervisor, without the overhead of having to pretend the guest OS has direct access to the hardware.

For an overview of quite a few virtualisation technologies, including data from performance tests, read this report. It only talks about Linux, but it covers Linux-Vserver, Xen, OpenVZ, KVM, VirtualBox and QEMU. Linux-Vserver and Xen were generally the best performers, but read the report to see the different workloads.

Having said all the above, there may be some areas where VirtualBox outperforms Xen. If your guest OS has a graphical windowing layer, then VirtualBox has good support for that, particularly if you install some special VirtualBox components in the guest OS.

And finally you should be aware that Xen will only run a modified guest OS. It cannot run an unmodified guest OS.