Monitoring host-ballooning activity
Ballooning is a part of normal operations when memory is overcommitted. The fact that ballooning occurrence is not necessarily an indication of a performance problem. The use of the balloon driver enables the guest to give up physical memory pages that are not being used. In fact, ballooning can be a sign that you're getting extra value out of the memory you have in the host.
However, if ballooning causes the guest to give up memory that it actually needs, performance problems can occur due to guest operating system paging.
Note, however, that this is fairly uncommon because the guest operating system will always assign already-free memory to the balloon driver whenever possible, thereby avoiding any guest operating system swapping.
In the vSphere Client, use the Memory Balloon metric to monitor a host's ballooning activity. This metric represents the total amount of memory claimed by the balloon drivers of the virtual machines on the host. The memory claimed by the balloon drivers can be used by other virtual machines. Again, this is not a performance problem, but it represents that the host starts to take memory from less needful virtual machines for those with large amounts of active memory. If the host is ballooning, check the swap rate counters (Memory Swap In Rate and Memory Swap Out Rate), which might indicate performance problems, but it does not mean that you have a performance problem presently. It means that the unallocated pRAM on the host has dropped below a predefined threshold.
In a world where a vast majority of VMs have oversized vRAM, much of the vRAM -> pRAM mapping is just holding zeroed-out free pages, and these will be freed up by ballooning, without displacing real data and not risking poor performance in the future.
Getting ready
To step through this recipe, you will need a running ESXi Server, a couple of memory-hungry Virtual Machines, a vCenter Server, and a working installation of vSphere Client. No other prerequisites are required.
How to do it...
Balloon activity can also be monitored in Performance Chart through vSphere Client. The metric that you should follow in this case is Balloon Average in kilobytes.
You should select the same metric when you monitor the Ballooning activity for ESXi as well.
To monitor the Ballooning activity using vSphere client for individual VM, follow these steps:
- Open vSphere Client.
- Log in to the vCenter Server.
- On your Home Screen, select VMs and Templates.
- Choose the memory-hungry VM.
- Go to the Performance tab, and switch to the Memory screen.
- Click on the Advanced tab, and select Chart Options.
- Select Balloon as the metric.
- Click on OK. Now you should see something similar to the following image if there is Ballooning activity on your VM:
In this example you can see that this VM (Memhog-VM3) is releasing its inactive memory pages to Host memory. Here it is 1582956 Kilobytes.
To monitor the Ballooning activity using vSphere client for your ESXi, you should follow these steps:
- Open vSphere Client.
- Log in to the vCenter Server.
- On your Home Screen, select Hosts and Clusters.
- Choose the poorly performing ESXi host.
- Go to the Performance tab and switch to the Memory screen.
- Click on the Advanced tab and select Chart Options.
- Select Balloon as the metric.
- Click on OK. Now you should see something similar to this if there is ballooning activity on your ESXi host:
In this example you can see that this ESXi host is involved in ballooning and its VMs are actively releasing inactive memory pages.
How it works...
In our previous recipe, we talked about how it works. Refer to the Virtual memory reclamation technique recipe.
There's more...
The basic cause of memory that ballooning is again memory overcommitment from using memory-intensive virtual machines. However, this is just indicative, which means that the presence of ballooning does not always say it's a performance problem. Ballooning is an effective way to use pRAM more efficiently, usually with no negative performance impact.
In order to maximize the ability of ESXi to recover idle memory from virtual machines, the balloon driver should be enabled on all virtual machines. The balloon driver should never be deliberately disabled on a virtual machine. Disabling the balloon driver might cause unintended performance problems.