VMware is one of the top virtualization software that allows you to create virtual machines and make the best use of your resources. One of the major focuses of virtualization solutions is to enable optimized use of resources like memory and computing power, but overcommitting your hypervisor towards greedy resource management can lead to severe degradation in the overall performance. You need to implement proper capacity planning and manage both performance and resource allocation when using VMware virtualization.
Here are some tips and suggestions that can help you achieve that balance and make the best out of your VMware CPU-ready virtualization software.
Understand the VMware Terms
Understanding how VMware vCenter works and the terms used could come in handy when you run diagnostics and monitor your virtual machines’ performance.
Capacity (Host Level)
Refers to the available physical memory on the host machine.
Consumed Memory (Host Level)
Includes memory used up by the virtual machine kernel, system processes, critical applications services, service console, and the overall memory utilized by the running VMs.
Memory Allocated For Each VM (VM Level)
This is the amount of allocated memory to each VM that includes the additional memory required for VM management as well. This memory will have a maximum limit set to it beyond which the VM cannot be granted any additional memory by the hypervisor. It is usually called the provisioned memory for each specific VM.
Memory Consumed At VM Level
Indicates the level of memory currently consumed by a specific VM.
Active Guest memory (VM level)
The estimate of memory that is currently being utilized by the Guest OS of a VM. As the hypervisor does not directly communicate with the guest OS, it estimates the memory consumption by the guest OS with the help of a random sample of VM’s allocated memory.
Minimum Free Memory
This value gives the threshold value for free memory, which will start the memory reclamation process. The variable used to indicate the free memory level is named mem.minFree
Vmware Memory Reclamation Techniques
When the minimum memory threshold is reached, VMware tries to reclaim memory to make some free space available.
Find below the techniques used to reclaim memory. The techniques are listed down in the order of their impact on performance.
TPS stands for transparent page sharing and works by removing duplicate memory pages. Memory pages of size 2MB and more are split into smaller sized memory pages. Then these are checked for any redundancy. This method has the least impact on the memory used by the guest OS of the VM and is only executed to be used within the VMs only.
VMware Memory Ballooning
Unused memory from the guest OS is reclaimed and is allocated back to the host system. This results in a reduction in the available memory amount for the VM machine’s OS while the total memory remains unchanged. Hence VM machine’s OS starts paging and experiences a significant degradation in performance as a result.
Memory pages that can be reduced in size are compressed to be at least 50% of the original size.
Memory pages are swapped to disk.
Based on the mem.minFree threshold value, any of the above reclamation techniques can be used in combination. Out of all the methods used, the TPS method ensures the best VM performance while other techniques like swapping and compression can cause serious performance issues. You will have to monitor your VM guest OS for paging and try to clear out idle memory before you reach the threshold value. If you need fast memory, you will have to use swapping as TPS and ballooning are relatively slower in freeing up memory.
Tips For Capacity Planning For Memory
- Do check memory use reports regularly to estimate the VM guest OS memory requirements. Doing so will alert you on when you need to close up some applications and free up memory so that other operations do not suffer from low-performance issues
- Do not try to use more memory than what is needed for your VM.
- Setting a memory reservation or running the VM on a host that is not overcommitted will help your VM from frequent memory reclamation by the hypervisor. You can use this method when the active guest memory estimate is a lot smaller than the actual guest OS memory use.
- In case you overcommit memory, keep monitoring the host consumed memory. As it gets nearer the allowed capacity, you can notice the hypervisor trying to reclaim memory using TPS or the ballooning methods. Take the corrective action required before the memory reclamation causes a performance issue.
- Try to avoid reaching the state where memory compression and swapping will be used by the hypervisor as these cause the most severe performance degradation. If you notice that ballooning does not resolve a memory issue, power down your VMs before they reach the hard limit.
CPU Usage Monitoring And Management
Besides memory management, performance is also impacted how well you manage your CPU usage.
What Is CPU Usage
CPU usage refers to processing power and time the CPU allocates to get a task or application function properly. The VM machine is said to have a good performance when the CPU usage is optimal. But some processes and applications can load the CPU and cause a slowdown. You need to check CPU usage regularly to know of any high demand and CPU intensive applications or processes and take the necessary action to prevent overall performance degradation.
How To Check CPU Usage
You can use CPU monitoring software, look up the performance stats of each application, network traffic, and so on. Common metrics used to analyze CPU usage include user time, processor time, device memory, CPU utilization, and so on.
Besides regular monitoring, following some best practices can also help you optimize CPU usage.
Here are some considerations when you allocate virtual CPUs (vCPUs) to your virtual machines.
- Allocate one vCPU per VM and increase the number on a needed basis
- Do not allocate more than what is required by the VM. Overcommitting CPU usage to one VM can limit other VMS resources and increase the CPU Ready Wait time.
- Keep the ratio of allocated vCPUS to the total vCPU at an optimal value. The best practice is to keep the ratio in between f 1:1 to 3:1. Above 3:1, you will start noticing performance issues, and anything above 6:1 will cause severe performance degradation.
- Monitor your VM with respect to their CPU usage. Make use of specialized VMware monitoring tools to help you quickly identify any alert situations. Some metrics you can use include:
- VM CPU utilization – Recommended value falls in the range of <=80%. You should set up alerts if the value reaches above 90%.
- VM CPU Ready – Recommended value should be in the range of <5%
- Co-Stop – Persistent co-stop value of above 3% calls for some remedial action and right-sizing of your resources.
- VMware host CPU utilization – Recommended value is <80%. Values above this range should be considered a warning and could soon lead to an overloaded condition.
To learn more about maximizing VMware performance and memory utilization, talk with our experts today.