Microsoft Hyper-V
Performance Tuning
Jan Marek
Principle Architect
Cloud and Datacenter Platform Team Lead
Who’s Jan?
• v-guy
• Hyper-V | App-V | MED-V | UE-V | Azure IaaS | VMware vSphere
• System Center
• Active Directory
• PowerShell
• MCSE | MCSA | MCITP | MCTS | MCT | MS
• Working with Hyper-V since it was Viridian
• Microsoft MVP for Hyper-V
This talk is about
• Microsoft Hyper-V (Windows Server / Hyper-V Server)
• 2012 R2
• Performance Tuning of
• Host
Host (BIOS)
• Latest BIOS/UEFI firmware
Host (Hardware)
• Latest NICs firmware and drivers (but test, test and test!)
• Avoid disabling VMQ (dVMQ)
• Enable Jumbo Frames for CSV, iSCSI and LM networks
• Disable Non-iSCSI communication types on iSCSI NICs
• Don’t use NIC teaming for iSCSI NICs – use MPIO
• NIC teaming inside guest OS (sw-dep) should use SR-IOV NICs
• Use 4k native disks
• Use 64k allocation unit size for drives hosting VHD(X)
• Use auto-size for Page File
• Use processors with SLAT support and large cache
• Do NOT use MemoryReserve reg key
Use Parent Partition PerfMon
• Always measure the CPU usage of the physical system by using
the Hyper-V Hypervisor Processor performance counters
Host (OS)
• Core OS Edition
• Windows Update + Hotfixes
&
• Antivirus Exclusions
Host (Hyper-V)
• Only Hyper-V role
• VM Default Paths on non-system drive
• Avoid multiple Virtual Network Switches (use VLANs)
• Do NOT share adapter with physical OS
• Do NOT leave Hyper-V Manager running
• Leave Host NUMA enabled
VM
vNUMA n1 vNUMA n1VM
No NUMAHost
Host
NUMA n1
NUMA n2
NUMA n1
NUMA n2
Virtual Machine
Virtual Machine
Virtual Machine
• Dynamic Memory
0 1000 2000 3000 4000 5000 6000 7000 8000 9000Example 1 Example 2 Example 3 Example 4 Demand Buffer/Free Memory Left
Virtual Machine
• Dynamic Memory
0 500 1000 1500 2000 2500 30001 hour 2 hours 3 hours 4 hours 5 hours 6 hours 7 hours 8 hours
High Weight
Minimum Demand Assigned
0 500 1000 1500 2000 2500 3000
1 hour 2 hours 3 hours 4 hours 5 hours 6 hours 7 hours 8 hours
Low Weight
Virtual Machine
• Use Legacy Network Adapter only for PXE boot (Gen 1)
• Remove unused vDevices (Gen 1)
hypervisor
hardware
VMbus
VSP
Driver
SYNTHETIC
LEGACY
Virtual Machine
Emulated 2 Synthetic
Virtual Machine
• Install and update IS
• Leave VM on logon screen + disable screen saver
• Do NOT use VMconnect as a standard to connect to VM
• Disable background activities:
• SuperFetch
• Windows Search
• Scheduled Tasks (Defrag,…)
Virtual Machine
• Avoid using DHCP Guard and Router Guard
• Don’t forget to turn off Port Mirroring after use
• For VLAN comm. use NICs with
NDIS_ENCAPSULATION_IEEE_802_3_P_AND_Q_IN_OOB encapsulation for
Large Send Offload and checksum offload
support
VM Storage
• Avoid CheckPoints
• Avoid vIDE for data disks (Gen 1)
• Use VHDX (instead of VHD or PT)
• Fixed VHDs are recommended
• Dynamic VHDXs are recommended
• Check VHD (not VHDX) data allignment
• Use ReFS in “Hyper-V vNext”
• Use Virtual HBAs only if needed
• Use Storage QoS
VM Storage
• Configure Advanced I/O balancer only if needed (reg)
HKLM\System\CurrentControlSet\Services\StorVsp\
\IOBalance_Enabled
HKLM\System\CurrentControlSet\Services\StorVsp\
\IOBalance_KeepHwBusyLatencyTarget_Microseconds
- how much work, represented by a latency value, the balancer allows to be issued to the hardware before throttling to provide better balance
- default is 83ms
HKLM\System\CurrentControlSet\Services\StorVsp\
\IOBalance_AllowedPercentOverheadDueToFlowSwitching
- how much work the balancer issues from a virtual machine before switching to another virtual machineCluster
• Use Hyper-V cluster only for Hyper-V HA services
• Separate Network Communication
• Mgmt | VM | LM | HB | CSV | iSCSI | Backup
• Set preferred network for CSV communication
• (Get-ClusterNetwork "Cluster Network 1").Metric = 700 (“< 1000”)
• Use CSV cache for read-oriented VMs (VDI)
• (Get-Cluster).BlockCacheSize = 1024
• LM: for >10Gbps use RDMA, for <10Gbps use compression
• LM: increase the number of send and receive buffers on each LM NIC
• Avoid using Low Priority VMs
SMB storage
• Use 10Gbps RDMA NICs
• Use Storage Spaces Write-Back Cache
• Async Hyper-V cluster is not supported
• Hosting SMB storage inside VM running on Hyper-V Cluster is
not supported
Thank you!
redtoo Prague Na Pankráci 1683/127 (Gemini A) Praha 4, 14000 Czech Republic [email protected] redtoo Brno Holandská 854/1 Brno, 639 00 Czech Republic [email protected]This presentation (the “Presentation”) has been prepared by redtoo s.r.o. (“redtoo”) on a non-reliance and non-recourse basis for information purposes and as a basis for discussion of certain issues mentioned therein.
The Presentation is incomplete without reference to, and should be viewed solely in conjunction with, the oral briefing provided by redtoo.
The Presentation meets legal criteria for a copyright work. Redtoo hereby grants to the user thereof a exclusive, non-transferable and perpetual license to use the Presentation for its own purposes only. The Presentation may not be
reproduced, its original or copies distributed, rented, lent or communicated to third parties, all that neither in a piece or in parts, without a prior explicit written approval granted by redtoo.
The Presentation has been prepared by redtoo on the basis of information in the public domain as well as confidential information provided by [source]. It reflects prevailing conditions and redtoo's views as of this date, all of which are subject to change. None of the information on which the Presentation is based has been independently verified by redtoo.
Neither redtoo nor any of its directors, employees and agents accept any liability with respect to the accuracy or
completeness, or in relation to the use by any recipient (any third party and/or the user), of the projections, information or opinions contained in the Presentation. Unless explicitly specified otherwise by redtoo in writing, if, notwithstanding the terms here, any recipient chooses to rely upon the Presentation or any part thereof, it agrees that it will do so at his/her own risk and without recourse to redtoo its directors, employees and agents.