Microsoft Hyper-V Performance Tuning Jan Marek Principle Architect Cloud and Datacenter Platform Team Lead jan.marek@redtoo.com
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 Virtual Machines resources
Host (BIOS) Latest BIOS/UEFI firmware Configure BIOS High Perf and GPO High Perf
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
Virtual Machine No NUMA vnuma n1 vnuma n1 VM vs. NUMA n1 NUMA n2 NUMA n1 NUMA n2 VM Host Host
Virtual Machine Supported Guest OS (pay attention to Generation version)
Virtual Machine 9000 Dynamic Memory 8000 7000 6000 5000 4000 3000 2000 1000 0 Example 1 Example 2 Example 3 Example 4 Demand Buffer/Free Memory Left Assigned
Virtual Machine Dynamic Memory 3000 2500 2000 1500 1000 500 0 High Weight 1 hour 2 hours 3 hours 4 hours 5 hours 6 hours 7 hours 8 hours Minimum Demand Assigned 3000 2500 2000 1500 1000 500 0 Low Weight 1 hour 2 hours 3 hours 4 hours 5 hours 6 hours 7 hours 8 hours Minimum Demand Assigned
Virtual Machine Use Legacy Network Adapter only for PXE boot (Gen 1) Remove unused vdevices (Gen 1) VSP VMbus SYNTHETIC LEGACY Driver hypervisor hardware
Legacy Network Adapter = Intel 21140
Virtual Machine Use Generation 2
Emulated 2 Synthetic Generation 1 VM Generation 2 VM
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, ) Aero (optimize for performance)
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 Configure vrss
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 machine - default is 8%
Cluster 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 info.prague@redtoo.com redtoo Brno Holandská 854/1 Brno, 639 00 Czech Republic info.czech@redtoo.com
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 non-exclusive, nontransferable 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. 2014 redtoo s.r.o.