Many blogger have discuss this topic in deeply and need to re-blog with changes in vSphere 6.x and above.I’ve recently been questioned by fellow mate,how the performance of Virtual machine is getting impact because of the Active and Consumed CPU and memory.EXSi is designed to provide the provide the hardware resource to VM for better performance of the VM.How this works,the VMKernel will be map the VM compute resource to underlying the hardware resource of the ESXi host.

Resource allocation of the VM will basically allocated on priority which has been provided shares, reservation, and limit.

pic1

Consumed Host CPU Cycle(GHz) is defined as the amount of host CPU Cycle(GHz) that is allocated to the virtual machine.

Consumed Host Memory usage is defined as the amount of host memory that is allocated to the virtual machine.

Active Guest Memory is defined as the amount of guest memory that is currently being used by the guest operating system and its applications.

Provisioned Storage is amount of the storage provided as Hard disk to VM and addition of the VM SWAP,vmx,log files and other files like hlog,snapshot logs.

Not-Shared Storage is amount of storage spaced allocated in the datastore and which is not a shared disk.

Used storage is amount of the storage shows the space actually occupied by the virtual machine files (Config Files,Log files,VMDK & snapshot,etc in the virtual machine folder.

This file size will get vary because it is thin provisioning and if in case thick the provisioned and used storage space will be same.

pci2

Lets get into the resource allocation tab for the VM, you can see two different column one is for CPU and another for memory.

Lets take the CPU in count CPU cycle will be schedule the Hypervisor cycle to process the compute produce by the VM.It is similar to memory, but here this will be CPU scheduler and resource settings.

Reservation – Amount of the guarantee MHz or MB will be allocated in the hardware compute state.

Shares – This will priority between the VM,when share is high this will priority it and less this will get the least priority.

Reference link :

http://www.vfrank.org/2013/09/19/understanding-vmware-reservations-limits-and-shares/

https://docs.vmware.com/en/VMware-vSphere/6.5/vsphere-esxi-vcenter-server-65-resource-management-guide.pdf

CPU Scheduler

Relaxed Co-Scheduling: CPU cycle will be schedule based when CPU not restrict CPU Cycle and time. Scheduling will done so that available CPU cycle will not be wasted.

In below example VM1 has 4 vCPU and VM 2 has 2 vCPU.

Row – Time

Column – CPU Cycle

VM 1 vCPU 4 VM2 vCPU2
   
VM1 vCPu1 VM1 vCPu2 VM1 vCPu3 VM1 vCPu4
VM2 vCPu1 VM2 vCPu2 VM1 vCPu1 VM1 vCPu2
VM1 vCPu3 VM1 vCPu4 VM2 vCPu1 VM2 vCPu2
VM1 vCPu1 VM1 vCPu2 VM1 vCPu3 VM1 vCPu4

Reference link :

https://www.vmware.com/content/dam/digitalmarketing/vmware/en/pdf/techpaper/vmware-vsphere-cpu-sched-performance-white-paper.pdf

Memory Technique:

Memory resource allocation will be similar to CPU but the technique alone will be varied.

Consumed Memory is amount of the VM memory consumed in the host which is mapped to physical memory.

Overhead Consumption is ESXi memory virtualization adds little time overhead to memory accesses. Because the processor’s paging hardware uses page tables (shadow page tables for software-based approach or nested page tables for hardware-assisted approach) directly, most memory accesses in the virtual machine can execute without address translation overhead.

pic3

Reference :

https://docs.vmware.com/en/VMware-vSphere/6.5/com.vmware.vsphere.resmgmt.doc/GUID-B42C72C1-F8D5-40DC-93D1-FB31849B1114.html

Guest Memory:

Private – amount of memory that is physically backed by the Host

Shared – amount of memory shared by TPS

Swapped – amount of memory reclaimed by VMkernel swapping

Compressed – amount of memory stored in the VMs compression cache

Ballooned – amount of memory reclaimed by the Balloon Driver

Unassessed – amount of memory that has never been referenced by the guest

Active – amount of memory actively used by the Guest OS.

Transparent page sharing (TPS)—reclaims memory by removing redundant pages with identical content.This technique is no longer enabled by default in the version 5.5 and later.

Refer the KB:

https://kb.vmware.com/s/article/2080735

http://www.yellow-bricks.com/2010/12/20/vcenter-and-memory-metrics/

Memory Techniques

Ballooning—reclaims memory when memory is tight in the Hypervisor, the guest operating system determines which will be release the VM memory to VMKernel and whenever it require it request the hypervisor get the resources.pic4

 

Memory compression— reclaims memory by compressing the pages that need to be swapped out.

Memory swapping—  Moves the a guests memory pages to a virtual machine based swap file (.vswp), which frees host physical memory for other virtual machines.

Reference :

https://docs.vmware.com/en/VMware-vSphere/6.5/com.vmware.vsphere.resmgmt.doc/GUID-2B1086F3-B3F5-426C-9162-3C3CDD23A5DF.html

https://www.vmware.com/content/dam/digitalmarketing/vmware/en/pdf/techpaper/perf-vsphere-memory_management.pdf

https://www.vmguru.com/2013/04/vsphere-5-memory-management-explained-part-2/

For Additional Information sign up and download the deep dive book By frank and Niels  https://blogs.vmware.com/feed-items/free-e-book-vmware-vsphere-6-5-host-resources-deep-dive/

Predictive DRS in vSphere 6.5 and later will be play a vital role in the active and consumed memory,latest DRS has ability to load balance the VM based the priority and availablity in the cluster.

Reference :

https://deepakkanda.wordpress.com/2018/04/03/whats-in-vsphere-cluster-6-5/

https://blogs.vmware.com/vsphere/2018/01/vsphere-6-5-drs-memory-balancing-non-overcommitted-clusters.html

Happy Sharing!!!

Advertisements