Welcome to the last installment for the blog series XenDesktop 7.1 planning on Hyper-V 2012 R2. Just to recap what was covered so far:
Part 1: I went over some of the new networking features in Windows Server 2012 and reviewed some key XenDesktop network design decisions.
Part 2: I covered the storage options available and some important storage design decisions.
Part 3: I covered System Center 2012 R2 Virtual Machine Manager and some design considerations when deploying XenDesktop 7.1.
I’ll finish out the blog series this week by listing some key optimizations for improving the performance of Hyper-V 2012 R2 and System Center 2012 R2 Virtual Machine Manager.
I will focus on the optimizations that I think are important for XenDesktop performance. This list is not all inclusive so feel free to test and apply other tips as you find them. Microsoft has a great site with guidelines for tuning Windows Server 2012 R2 in general and when running specific roles like Hyper-V, Web Services, Active Directory, or Remote Desktop Services.
|Enable CSV cache||I touched on this in part 2 of the blog series, but I want to reiterate it again here. There is remarkable improvement to XenDesktop when using MCS with the CSV cache enabled because it allows the VHD/VHDX file to be cached in memory. By default the CSV cache is disabled. Please see How to Enable CSV Cache for more information.|
|Turn off .BIN file creation for pooled desktops||When the Automatic Stop Action in VMM is set to “Save the virtual machine state”, a .BIN file is created for every VM. The size of the .BIN file matches the amount of RAM assigned to the VM. In a VDI scenario that can add up to a lot of unused disk space. Also when working with pooled desktops, saving the virtual machine state is not necessary. Set the Automatic Stop Action to either “Turn off the virtual machine” or “Shut down the guest operating system”. Please see the Microsoft TechNet blog on how to use VMM cmdlets to change VM startup and shutdown actions.|
|Enable the “High Performance” power scheme in Windows Power Plans||By default Windows Server 2012 R2 uses the Balanced power plan, which enables energy conservation by scaling the processor performance based on current CPU utilization. On some systems this can degrade server performance and cause issues with CPU-intensive applications. The setting can be changed under Control Panel – Power Options.|
|Disable CPU Core Parking||CPU core parking can have a negative effect on Hyper-V performance and should be used with caution in environments where high performance is important. The default behavior changed in Windows Server 2012. Read here for more information.|
|Close the Hyper-V manager when not in use||The Hyper-V manager continuously refreshes the virtual machine’s thumbnail which uses system resources.|
|Enable offload tasks on physical network adapters||Offloading tasks reduces CPU usage of network IOs. Hyper-V supports LargeSend Offload (LSOv1, LSOv2) and TCP checksum offload (TCPv4, TCPv6). Some drivers for certain network adapters disable LSOv1 and enable LSOv2 by default. LSOv1 can be enabled by using the Properties setting for the network adapter in Device Manager.|
|Perform Server Core installation on Hyper-V host||The Windows Server 2012 R2 Server Core installation offers a minimal environment, features a smaller disk, memory profile and attack surface.|
|Do not install other roles on Hyper-V server||To avoid resource contention with other server roles, do not install additional roles on the parent partition.|
|Do not enable unnecessary features||To avoid resource contention with other server features, do not enable additional features other than Failover Clustering, if the host will be part of a cluster, and Multipath I/O, if the host will be connected to iSCSI, Fibre Channel, or Storage Spaces storage.|
|Set anti-virus exclusions||Anti-virus scans should exclude the following Hyper-V files:
|Enable jumbo frames||Turn on jumbo frames and set it for 9000 or 9014 for Cluster Shared Volumes, iSCSI and Live Migration networks. This can significantly increase throughput while also reducing CPU cycles. To verify jumbo frames are working, use the Ping command with –f and –l switches and specify a large packet size. If replies are received, the jumbo frames are properly configured. For example, Ping <destination IP> -f –l 8000|
|Do not configure provisioned VMs to start automatically||Provisioned virtual machines should not be configured to start automatically in VMM as this will conflict with the power operation commands issued by the XenDesktop controllers. This setting can be changed in the properties of the virtual machine. By default VMM does not start virtual machines automatically.|
|Disable unnecessary services and applications||Disabling unnecessary services and applications will reduce VM resource consumption.|
|Do not overcommit vCPU||Overcommitting can diminish the server’s overall performance and degrade virtual machine performance.|
|Limit the number of checkpoints (snapshots)||When there is a large hierarchy of checkpoints, Hyper-V has to perform a lot of read operations. This creates a lot of I/O overhead.|
|Configure VMs with dynamic memory||Dynamic memory adjusts the amount of memory available to a virtual machine, based on memory demand, which helps use memory resources more efficiently. Please visit the TechNet blog page on Hyper-V best practices for the recommended minimum dynamic memory setting by operating system.|
I did not touch on optimizing the guest virtual machines because there are some great Citrix articles already available:
- For optimizing Windows 8/8.1 I recommend reading the Windows 8 and 8.1 Virtual Desktop Optimizing Guide.
- For Windows 7 I recommend reading the Windows 7 Optimization Guide.
- For Windows Server 2008 R2 I recommend the Windows 2008 R2 Optimization Guide.
If you’re interested in learning about how to automate XenDesktop deployments on Hyper-V using PowerShell scripts, please check out the blog series XenDesktop Automation with PowerShell by my colleague Roger LaMarca.
If you have other tips for optimizing Hyper-V performance please add your comments. I and others in the Citrix community would love to read them. I hope you found this blog series helpful and enjoyable.