(VMware) Will a Linux guest VM swap when RAM usage is high even though Active is not

memory

We are currently having a discussion in my environment. The assumptions are that

“The tools that are designed for a physical infrastructure memory management in Linux such as top, free, vmstat, /proc/meminfo don’t work on a VM in an ESXi hypervisor because they rely on the OS’s ability to monitor the physical RAM directly in a bare metal system. In a virtual infrastructure, the guest OS can't see the physical hardware, only the virtual hardware that has been emulated by the (ESXi) hypervisor. Because an OS can't directly access most of the host server's physical hardware, traditional performance monitoring tools won't function properly in a virtual infrastructure.”

In the VM guest (SLES 11) we’re seeing RAM utilization at around 93%. However in the vSphere/vCops is showing 5072309 kb Active Write of 8388608 (8GB) KB of allocated RAM. Roughly about 60.46 % utilization rate.

The question, is the above assumption correct and if so:

If top inside the guest is inaccurate in the VM and it reaches 100% RAM utilization does the VM guest then swap and if so I presume with the vswp which is located on the SAN and cause a slowdown on the VM Guest?

Best Answer

It depends. You should rely on the in-VM tools like top, vmstat, etc. They are accurate, assuming that your physical resources aren't too overcommitted and you've installed the VMware tools. At the vSphere level, you still have memory ballooning, TPS, compression and swap as fallbacks. The memory management really isn't that bad.

Also understand that vSphere/vCenter metrics and vCops metrics are totally different (vCops was acquired by VMware and uses its own algorithms to measure resource utilization).

Measure utilization at the VM level. Plan cluster-level resources using vCops or vCenter.

Don't overcommit your RAM too much because that WILL skew metrics and have a tangible performance impact.

They type of application also matters. If it's heavy Java-based, some other approaches (partial or full reservations) are necessary to help them run effectively in a vSphere environment.