Xen or VMware or OpenVZ? Of course openVZ is not mutually exclusive with either Xen or VMware. They can be used together, but that is not the purpose of this post...
I found an interesting link to a forum post on the centos mailing list talking about OpenVZ today.
It says that once the memory limits are reached in an OpenVZ Virtual Environment (VE) it kills the process that hit the limit.
<speculation>I suspect (since I haven't researched and found the details yet) that after reaching the memory limit in a VE, OpenVZ simply refuses allocating memory when processes request more memory. That can be bad because a lot of apps don't handle this very well and die. You would see this also if you simply limited the memory allowed to a process group or user.</speculation>
What happens differently when a virtualized kernel (like in Xen or VMware) hits its physical memory limit is that it starts using swap and if swap is full or unavailable[1] it will discard as many memory pages as possible, disk cache, exeutables mmmap()ed, etc. This can allow more memory to be allocated, though with a serious drop in performance.
But the kernel tries hard to satisfy the allocation before refusing.
If my speculation above is correct and OpenVZ hasn't made any modifications to the linux Virtual Memory Manager so it will simulate "memory pressure" in each VE independently, then OpenVZ (and presumably the generic Linux resource limits code) will simply reach the limit and refuse further allocations without trying hard to find space for allocations and have serious problems with applications that don't handle memory allocation failures properly (that would be most programs).
This needs to be looked into further...
1. Some people have gotten into the habbit of configuring systems without swap. This mostly started because of the terrible VMM in the early 2.4.x kernel series. If you're running a kernel from kernel.org after 2.4.16 or any distro kernel, you should configure swap space on your system(s).
Tags: centos5, linux, openvz, virtualization, vmware, xen
|