VMworld 2014/Extreme Performance Series: Understanding Virtualized Memory Management Performance

Motivations
configured memory size:
 * too small impacts performance
 * too large impacts overhead

number of VMs per host:
 * too many impacts performance
 * too few wastes host memory

memory reclamation method:
 * properly implemented, will minimally impact performance

Layers
Memory Layers
 * App (ex. Java)
 * VM (Guest OS)
 * Host (ESX)

Each layer does memory management differently

Terminology

 * Memory Size
 * Free Memory
 * Allocated Memory
 * Active Memory
 * Idle Memory

Memory Undercommit
 * Sum of all VM memory is less than host memory
 * No reclamation of guest memory, even if VM has free/idle memory

Memory Overcommit
 * Sum of all VM memory is more than host memory
 * ESX may map only a subset of VM memory

Active, Idle, Cache, Free, Ballooned

entitlement
Memory Entitlement and Reclamation
 * compute memory entitlement for each vm, then reclaim guest memory if entitlement is less than consumed
 * computed on Reservation, Limit, Shares, and Memory demand
 * esx can only classify memory broadly as active and idle
 * sampling baed demand estimation is reasonably accurate

Parameters:
 * configured memory size
 * memory reservation
 * memory limit
 * memory shares
 * idle memory ("idle memory tax")

Memory Reclamation Techniques
Memory Reclamation Techniques
 * Transparent page sharing - de-dup identical memory pages (low cpu cost technique, uses content hasing)
 * Ballooning
 * Compression
 * Swapping

Performance Implications
Designed to handle burst memory pressure well

Constant memory pressure should be handled by DRS/vMotion etc.

Monitoring Tools

 * vCenter performance chart
 * esxtop
 * memstats
 * vCenter Operations (vCOps) - add on software
 * custom UI: http://vcops-host/vcops-custom

VM Sizing

 * guard against "active memory" reclamation
 * sized larger than highest demand during peak loads

Page Sharing & Large Page

 * Savings can be significant for homogeneous VMs (like VDI)
 * "Preventers":
 * ASLR (Address space Layout Randomizaiton) - for security
 * Super fetching (proactive caching)
 * Host large pages (ESXi does not share large pages)
 * Due to fewer TLB misses and faster page table look up time

Best Practices

 * Install VMware Tools and enable ballooning - better performance than host swapping
 * Provide sufficient swap space in guest
 * Place guest swap file/partition on separate vdisk
 * Don't disable memory compression
 * Host cache is "nice to have"

Optimize Host Swapping

 * Sharing before swap
 * Compressing before swap
 * Swap to host cache (SSD)
 * Target 20% for SSD
 * Too big host cache is potentially a waste

Transient memory Pressure
Transient memory pressure is not a problem