OpenVZ vs KVM for Linux VMs

kvm-virtualizationopenvzpfsense

Hardware: Intel® Core™ i7-920, 12 GB DDR3 RAM, 2 x 1500 GB SATA-II HDD (no SoftRaid because Proxmox developers don't support softraid and they are sure you'll run into problems)

Software: Proxmox VE with KVM and OpenVZ support and debian everywhere

I want to run multiple Linux VMs on this server. One for a firewall (I want to try pfSense), one for MySQL, one VM for nginx (my stuff) and ~2 VMs with nginx for other people's web sites.

I don't think that pfSense will run in an OpenVZ environment but it should run in KVM.

The question is if I should setup the other VMs using KVM or OpenVZ. In OpenVZ they should have less overhead for the OS itself but I don't know about the performance. I heard that KVM is more stable but needs more RAM and CPU.

I found this diagram showing a OpenVZ setup on the same hardware I'm using. This guy uses an own VM for each and every website which is running on his server. I can't think of any advantage why he's using so many VMs.

Edit:

Is there a way to give the VMs "dynamic" RAM in OpenVZ or KVM? I mean so they can take as much memory as available and not as much as I dedicated to them.

Best Answer

On OpenVZ all VM and host share the same kernel, so you won't be able to install pfsense (which is based on FreeBSD). Even on KVM you will have problems with pfsense because virtio drivers are not yet ported to FreeBSD as far as I know. So you will have degraded performance compared with linux VM. If you can live with that I don't know. Depends probably on this firewall's expected load.
In KVM you can allocate to VMs more memory then is physically available. It is called Memory Overcommit. There are several ways to do that: Swapping, Ballooning, Page sharing, Live migration.

Related Topic