2

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.

4 Answers 4

2

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.

2

nginx and MySQL work well in OpenVZ and OpenVZ uses fewer resources than KVM. I recommend OpenVZ VM for the speed.

KVM VM more flexibility. pfSense(FreeBSD) runs only in KVM.

1

I chose KVM with KSM. Proxmox has kernel w/o OpenVZ but with KSM. For me sometimes it's hard and takes a lot of time to tune system limits per each VM in OpenVZ. So my choice is KVM. I use gentoo as VM.

2
  • I'd prefer a way with dynamic ram (if this exists). I edited the first post. What does KSM do?
    – Eliasdx
    Jan 30, 2011 at 17:08
  • sorry, not KMS but KSM. linux-kvm.org/page/KSM
    – Denis Kot
    Feb 13, 2011 at 12:59
1

Is there a way to give the VMs "dynamic" RAM in OpenVZ

Yes, you can adjust the total memory and disk space that a VM can allocate in OpenVZ while it is running. Typically, to make it as easy as possible, I start with the unlimited settings for everything and just lower this setting, called "privvmpages"

To answer the original question - OpenVZ is what is known as a "container" VM as opposed to a "hypervisor." This means that you get a virtual copy of "init" with the root directory set to a directory somewhere on the file system (aka "chroot"). You only get a sub-set of devices, though, and can't use kernel modules. This is why it can be tricky to get a VM to boot up (especially with @#%@% upstart). And forget about things like GFS or Oracle RAC :)

But it is worth it for the native CPU & disk performance, ease of moving files into the VM from the host just using "cp", and the easy aliased networking (no bridging required if you're not broadcasting).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .