This is the third article (here is the previous one) of a series regarding memory management in VMware ESX/ESXi strategy advised by Eco4Cloud and facilitated through the use of Eco4Cloud’s workload consolidation, smart ballooning and troubleshooter solutions. The topic of this article is Memory Ballooning.
The original difference between legacy and virtualized environment is the presence of a hypervisor, such as VMware ESX/ESXi. This kind of software has the main goal of decoupling operating systems and physical hosts, and inject intelligence in resource allocation to applications.
Ok, but why such an obvious introduction?
This OS/host decoupling, or VM isolation, introduced by several virtualization platforms (e.g. VMware ESX/ESXi and others) carries along a drawback, as the guest operating system is not aware that it is running inside a virtual machine and is not aware of the states of other virtual machines on the same host. When the hypervisor runs multiple virtual machines and the total amount of the free host memory becomes low, none of the virtual machines will free up guest physical memory because the guest operating system cannot detect the host’s memory shortage altogether. Ballooning makes the guest operating system aware of the low memory status of the host.
VMware achieves that through the installation of a balloon driver, via VMware tools. The balloon driver will take charge of making the guest operating system aware of host memory shortage, by allocating memory, pinning it and making it available to the host, when it will communicate its memory pressure state to the balloon driver.
The problem is that, as soon as memory pressure is detected at the host level, all the balloon drivers in each VM will scan the entire VM memory, searching for free memory page, which will lead to two intrinsic drawbacks:
- high CPU utilization during host memory pressure situations;
- the memory allocated by the balloon driver will be available at the host level, but guest OS will consider it as not available, so memory ballooning is fundamentally a tool transferring memory pressure from the physical host to the virtual machines.
The final result is that memory ballooning deteriorates application performances.
Smart Ballooning is a software developed by Eco4Cloud for virtual machines memory management for VMware’s virtualization platform. Smart Ballooning is different from “simple” ballooning in its selectiveness.
In fact, Smart Ballooning constantly monitors virtual machines performances metrics, and when it spots a possibility of memory waste at guest level, it induces memory ballooning selectively into that virtual machine. This approach lead to several advantages:
- Smart Ballooning frees up unused guest memory, making it available to the host constantly, not only during host memory pressure;
- host memory pressure situations are less likely to happen as there is always more RAM memory available than without Smart Ballooning;
- less CPU usage due to memory ballooning exactly in those moments (memory pressure) when the hosts are under stress;
- memory is often the bottleneck resource in a virtualized environment, so a higher memory over-commitment lead to higher consolidation ratios.