Virtual desktops is all about return on investment, lower the total cost of ownership while reducing support and delivering a service as good if not better than available on a traditional thick client. A key component of reducing the cost is density; how many virtual machines can you fit on a single server and for what cost?
Recently I started working on an optimization package that I could apply to most of my vDisks to lower ram usage, lower disk IOPS usage and ensure a smooth end user experience. The below list of optimizations have been cobbled together by me from other peoples recommendations, best practices and some optimizations I thought might be useful.
These optimizations include dropping un-needed events from event logs, capping event log size, optimizing the TCP stack for PVS, disabling un-required services, disabling visual effects and optimizing the file system. Many of the same optimizations I use when building an efficient over clocking operating system work great with virtual desktops, so this was a fun project for me.
I am using these optimizations on my production machines and they are all working well, but you should still thoroughly test them in a development environment before going live in case they conflict with your current configurations.
Simply copy the below into a .cmd batch file, boot your vDisk in private mode and execute the file.
The Optimizations
REM ----------------SOF HERE----------------
@echo off
REM Xendesktop 5 optimizations by James Trevaskis
REM Published on 17/10/2011 - Use at your own risk
REM TCP optimizations
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\parameters" /v DisableDHCPMediaSense /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\parameters" /v KeepAliveTime /t REG_DWORD /d 60000 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\parameters" /v KeepAliveInterval /t REG_DWORD /d 100 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\parameters" /v TcpMaxDataRetransmissions /t REG_DWORD /d 10 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\parameters" /v DisableTaskOffload /t REG_DWORD /d 1 /f
REM server and workstation service optimizations
reg add "HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters" /v MaxWorkItems /t REG_DWORD /d 512 /f
reg add "HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters" /v MaxMpxCt /t REG_DWORD /d 2048 /f
reg add "HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters" /v MaxFreeConnections /t REG_DWORD /d 100 /f
reg add "HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters" /v MinFreeConnections /t REG_DWORD /d 32 /f
reg add "HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v MaxCmds /t REG_DWORD /d 2048 /f
reg add "HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v UtilizeNTCaching /t REG_DWORD /d 0 /f
reg add "HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v MaxThreads /t REG_DWORD /d 17 /f
REM memory management
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v LargeSystemCache /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v IoPageLockLimit /t REG_DWORD /d "65536" /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v DisablePagingExecutive /t REG_DWORD /d 1 /f
reg add "HKLM\System\CurrentControlSet\Control\Session Manager" /v RegistryLazyFlushInterval /t REG_DWORD /d "30" /f
REM netlogon wait
reg add "HKLM\SOFTWARE\microsoft\Windows NT\CurrentVersion\Winlogon" /v WaitForNetwork /t REG_DWORD /d 1 /f
REM dont display last logon name
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v DontDisplayLastUserName /t REG_DWORD /d 1 /f
REM disable services
reg add "HKLM\SYSTEM\CurrentControlSet\Services\wuauserv" /v start /t REG_DWORD /d 4 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\CiSvc" /v start /t REG_DWORD /d 4 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\BNNS" /v start /t REG_DWORD /d 4 /f
REM increase services timeout
reg add "HKLM\SYSTEM\CurrentControlSet\Control" /v start /t REG_DWORD /d "120000" /f
REM priority control optimize foreground tasks
reg add "HKLM\SYSTEM\CurrentControlSet\Control\PriorityControl" /v Win32PrioritySeparation /t REG_DWORD /d 38/f
REM disable dr watson
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug" /v Debugger /t REG_SZ /d "" /f
REM visual effects (you may or may not want to apply this)
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" /v VisualFXSetting /t REG_DWORD /d "2" /f
REM print optimizations
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Print\Providers" /v EventLog /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Spooler" /v ErrorControl /t REG_DWORD /d 2 /f
REM event log
reg add "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application" /v MaxSize /t REG_DWORD /d "2097152" /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application" /v Retention /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\System" /v MaxSize /t REG_DWORD /d "2097152" /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\System" /v Retention /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application" /v Retention /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Security" /v MaxSize /t REG_DWORD /d "2097152" /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Security" /v Retention /t REG_DWORD /d 0 /f
REM disable terminal services client printer mapping
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v fDisableCpm /t REG_DWORD /d 1 /f
REM file system
reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v NtfsDisableLastAccessUpdate /t REG_DWORD /d 1 /f
REM misc
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Windows" /v ErrorMode /t REG_DWORD /d 2 /f
echo Xendesktop optimizations complete
REM ----------------EOF----------------
Can you elaborate on what each of these REG changes does? Are you running XD 5.5?
ReplyDeleteah yeah mate i am happy to do that for you soon, a little busy for the next few weeks, but will do,
Deleterunning XD 5.5 on my environment, PVS 6.0, Xenserver 6.0
This post is very simple to read and appreciate without leaving any details out. Great work! cheap rdp
ReplyDelete