CitrixTools.Net Articles

Current Articles | Categories | Search | Syndication

Windows 2008 R2 Remote Desktop and XenApp 6 Tuning Tips Update

Following the great article Terminal Server & XenApp Tuning Tips published on this website by Pierre Marmignon, this article defined all tips that I’ve found, test and validate for tuning Windows 2008 R2 and XenApp6.

Please note that :
-       These informations are provided "as is" and that using these tips is at your own risks.
-       All this tuning tips have been tested and validated only on VMs running on Vmware Vsphere 4, let us know your feeback related to any other platform (either Hypervisor or physical server).
 
Windows 2008 R2 OS Tuning Tips for Remote Desktop Service and XenApp 6
 
Registry Hive
Value
Type
Data
Purpose(s)
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\parameters
 KeepAliveTime
 REG_DWORD
180000
Determines how often TCP sends keep-alive transmissions
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\parameters
 KeepAliveInterval
 REG_DWORD
 100
Determines how often TCP repeats keep-alive transmissions when no response is received
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\parameters
 TcpMaxDataRetransmissions
 REG_DWORD
 10
Determines how many times TCP retransmits an unacknowledged data segment on an existing connection
HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters
 MaxWorkItems
 REG_DWORD
 512
Server Service Optimization
HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters
 MaxMpxCt
 REG_DWORD
 2048
Server Service Optimization
HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters
 MaxFreeConnections
 REG_DWORD
 100
Server Service Optimization
HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters
 MinFreeConnections
 REG_DWORD
 32
Server Service Optimization
HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters
 UtilizeNTCaching
 REG_DWORD
 0
Disable Caching
HKLM\SYSTEM\CurrentControlSet\Services\MRXSmb\Parameters
 OplocksDisabled
 REG_DWORD
 1
Disables Opportunistic Locking
HLM\SYSTEM\CurrentControlSet\Services\Lanmanworkstation\Parameters
 UseOpportunisticLocking
 REG_DWORD
 0
Disables Opportunistic Locking
HKLM\SYSTEM\CurrentControlSet\Services\Lanmanserver\Parameters
 EnableOplocks
 REG_DWORD
 0
Disables Opportunistic Locking 
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\parameters
EnableRSS
 REG_DWORD
0
Disable Receive Side Scaling
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\parameters
EnableTCPA
 REG_DWORD
0
Disable TCP-acceleration
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\parameters
EnableTCPChimney
 REG_DWORD
0
Disable TCP Chimney Offload
 
HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
DisableBandwidthThrottling
 REG_DWORD
1
The default is 0. By default, the SMB redirector throttles throughput across high-latency network connections in some cases to avoid network-related timeouts. Setting this registry value to 1 disables this throttling, enabling higher file transfer throughput over high-latency network connections
HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters
 MaxThreads
 REG_DWORD
 17
Maximum Concurrent Threads
HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
DisableLargeMtu
 REG_DWORD
0
The default is 1. By default, the SMB redirector does not transfer payloads larger than approximately 64 KB per request. Setting this registry value to 0 enables larger request sizes, which can improve file transfer speed.
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\parameters
 EnableWsd
 REG_DWORD
 0
The default is 1 for client operating systems. By default, Windows Scaling Diagnostics (WSD) automatically disables TCP receive window auto tuning when heuristics suspect a network switch component might not support the required TCP option (scaling). Setting this registry setting to 0 disables this heuristic and allows auto tuning to stay enabled. When no faulty networking devices are involved, applying the setting can enable more reliable high-throughput networking via TCP receive window auto tuning. For more information about disabling this setting
HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
FileInfoCacheEntriesMax
 REG_DWORD
32768
The default is 64 with a valid range of 1 to 65536. This value is used to determine the amount of file metadata that can be cached by the client. Increasing the value can reduce network traffic and increase performance when a large number of files are accessed
HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
DirectoryCacheEntriesMax
 REG_DWORD
4096
The default is 16 with a valid range of 1 to 4096. This value is used to determine the amount of directory information that can be cached by the client. Increasing the value can reduce network traffic and increase performance when large directories are accessed
HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
FileNotFoundCacheEntriesMax
 REG_DWORD
32768
The default is 128 with a valid range of 1 to 65536. This value is used to determine the amount of file name information that can be cached by the client. Increasing the value can reduce network traffic and increase performance when a large number of file names are accessed.
 
HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
MaxCmds
 REG_DWORD
32768
The default is 15. This parameter limits the number of outstanding requests on a session. Increasing the value can use more memory, but can improve performance by enabling deeper request pipelining. Increasing the value in conjunction with MaxMpxCt can also eliminate errors encountered due to large numbers of outstanding long-term file requests, such as FindFirstChangeNotification calls. This parameter does not affect connections with SMB 2 servers.
 
 
 
 
 
 
Windows 2008 CPU Tuning (for VM only)
 
Because I’m working with VMware VSphere Server 4, I Supposed that the Hypervisor manage my processor and I don’t want to have any CPU management in the VM, I force all my VM to the ``min  Power Scheme``  (High Performance) with the following command ``owercfg -setactive scheme_min``
And force my Processor Performance Boost Policy, Minimum and Maximum Processor Performance State and Processor Performance Core Parking Maximum and Minimum Cores to the maximum. (http://www.microsoft.com/whdc/system/sysperf/Perf_tun_srv-R2.mspx
The following commands set Processor Performance Boost Policy to 100 percent on the current power plan:
Powercfg -setacvalueindex scheme_current sub_processor 45bcc044-d885-43e2-8605-ee0ec6e96b59 100
Powercfg -setactive scheme_current
The following commands set Processor Performance State parameters to 100 %
Powercfg -setacvalueindex scheme_current sub_processor 893dee8e-2bef-41e0-89c6-b55d0929964c 100
Powercfg -setactive scheme_current
Core parking is a new feature in Windows Server 2008 R2. The processor power management (PPM) engine and the scheduler work together to dynamically adjust the number of cores available to execute threads, to turn off core parking, set the Minimum Cores parameter to 100 percent by using the following commands:
Powercfg -setacvalueindex scheme_current sub_processor bc5038f7-23e0-4960-96da-33abaf5935ec 100
Powercfg -setactive scheme_current
 
Additional Windows Explorer Tuning
 
Registry Hive
Value
Type
Data
Purpose(s)
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
 UseDesktopIniCache
 REG_DWORD
 1
http://support.microsoft.com/kb/840309/EN-US
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
 NoRemoteRecursiveEvents
 REG_DWORD
 1
http://support.microsoft.com/?scid=kb%3Ben-us%3B330929&x=9&y=10
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
 NoRemoteChangeNotify
 REG_DWORD
 1
http://support.microsoft.com/?scid=kb%3Ben-us%3B812669&x=14&y=12
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
 StartRunNoHOMEPATH
 REG_DWORD
 1
http://support.microsoft.com/?scid=kb%3Ben-us%3B264061&x=18&y=9
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
 NoRecentDocsNetHood
 REG_DWORD
 1
http://support.microsoft.com/?scid=kb%3Ben-us%3B264061&x=18&y=9
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
 NoDetailsThumbnailOnNetwork
 REG_DWORD
 1
http://support.microsoft.com/?scid=kb%3Ben-us%3B830903&x=17&y=18
HKLM\System\CurrentControlSet\Services\MRXSmb\Parameters
 InfoCacheLevel
 REG_DWORD
 16
http://support.microsoft.com/kb/834350/EN-US
HKCR\*\shellex\PropertySheetHandlers\CryptoSignMenu
 SuppressionPolicy
 REG_DWORD
 1048576
http://support.microsoft.com/kb/829700/EN-US
HKCR\*\shellex\PropertySheetHandlers\{3EA48300-8CF6-101B-84FB-666CCB9BCD32}
 SuppressionPolicy
 REG_DWORD
 1048576
http://support.microsoft.com/kb/829700/EN-US
HKCR\*\shellex\PropertySheetHandlers\{883373C3-BF89-11D1-BE35-080036B11A03}
 SuppressionPolicy
 REG_DWORD
 1048576
http://support.microsoft.com/kb/829700/EN-US
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\SCAPI
 Flags
 REG_DWORD
 1051650
http://support.microsoft.com/kb/829700/EN-US
HKLM\\SYSTEM\CurrentControlSet\Control\Session Manager
 SafeDllSearchMode
 REG_DWORD
 1
http://support.microsoft.com/kb/306850/EN-US
HKLM\\SYSTEM\CurrentControlSet\Control\Session Manager
 SafeProcessSearchMode
 REG_DWORD
 1
http://support.microsoft.com/?scid=kb%3Ben-us%3B905890&x=13&y=9
 
Windows 2008 R2 - RDP Tuning   
Registry Hive
Value
Type
Data
Purpose(s)
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\UserOverride\Control Panel\Desktop
 AutoEndTasks
 REG_SZ
 1
Determines whether user processes end automatically when the user either logs off.
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\UserOverride\Control Panel\Desktop
 WaitToKillAppTimeout
 REG_SZ
 20000
Determines how long the system waits for user processes to end after the user attempts to log off
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\UserOverride\Control Panel\Desktop
 MenuShowDelay
 REG_SZ
 10
Changes the Start menu display interval
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\UserOverride\Control Panel\Desktop
 CursorBlinkRate
 REG_SZ
 -1
Specifies how much time elapses between each blink of the selection cursor
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\UserOverride\Control Panel\Desktop
 DisableCursorBlink
 REG_DWORD
 1
Enables / Disables Cursor Blink
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\UserOverride\Control Panel\Desktop
 DragFullWindows
 REG_SZ
 0
Specifies what appears on the screen while a user drags a window / Only the outline of the window moves
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\UserOverride\Control Panel\Desktop
 SmoothScroll
 REG_DWORD
 0
Scrolls using smooth scrolling
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\UserOverride\Control Panel\Desktop
 Wallpaper
 REG_SZ
 (none)
Sets Wallpaper to "None"
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\UserOverride\Control Panel\Desktop\WindowsMetrics
 MinAnimate
 REG_SZ
 0
Disabled. Window does not animate while being resized
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\UserOverride\Control Panel\Desktop
 InteractiveDelay
 REG_DWORD
 40
Optimizes Explorer and Start Menu responses Times
 
XenApp 6.0 - ICA tuning
  
Registry Hive
Value
Type
Data
Purpose(s)
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\ICA-Tcp\UserOverride\Control Panel\Desktop
 AutoEndTasks
 REG_SZ
 1
 Determines whether user processes end automatically when the user either logs off.
 
 
 
 
 
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\ICA-Tcp\UserOverride\Control Panel\Desktop
 WaitToKillAppTimeout
 REG_SZ
 20000
Determines how long the system waits for user processes to end after the user attempts to log off
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\ICA-Tcp\UserOverride\Control Panel\Desktop
 MenuShowDelay
 REG_SZ
 10
Changes the Start menu display interval
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\ICA-Tcp\UserOverride\Control Panel\Desktop
 CursorBlinkRate
 REG_SZ
 -1
Specifies how much time elapses between each blink of the selection cursor
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\ICA-Tcp\UserOverride\Control Panel\Desktop
DisableCursorBlink
REG_DWORD
 1
Enables / Disables Cursor Blink
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\ICA-Tcp\UserOverride\Control Panel\Desktop
 DragFullWindows
 REG_SZ
 0
Specifies what appears on the screen while a user drags a window / Only the outline of the window moves
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\ICA-Tcp\UserOverride\Control Panel\Desktop
 SmoothScroll
 REG_DWORD
 0
Scrolls using smooth scrolling
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\ICA-Tcp\UserOverride\Control Panel\Desktop
 Wallpaper
 REG_SZ
 (none)
Sets Wallpaper to "None" 
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\ICA-Tcp\UserOverride\Control Panel\Desktop\WindowsMetrics
 MinAnimate
 REG_SZ
 0
Disabled. Window does not animate while being resized 
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\ICA-Tcp\UserOverride\Control Panel\Desktop
 InteractiveDelay
 REG_DWORD
 40
Optimizes Explorer and Start Menu responses Times
 
Please note that using these tips is at your own risks.
All these tips have been test with XenApp6 server running on VMware Vsphere 4 and should be test on your own environment.
Sources :
 
Author : Julien Sybille
CCEA & CCA XenDesktop

 

posted on Monday, December 06, 2010 3:51 AM by Julien.sybille    

Previous Page | Next Page

COMMENTS

Very nice article Julien!

According to Thomas Koetzing paper on "Optimizing Logon and Logoff 1.4" available at http://www.thomaskoetzing.de/index.php?option=com_docman&task=doc_download&gid=135

the registry key HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\UserOverride dosen't work anymore with Windows 2003 and 2008/2008 R2 I assume.

Here what he had to say on page 22: "With Windows 2003 those global keys don't work anymore and has to be set on a per user basis."

I tested it my self with existing profiles and it didn't work...but I just read this morning that the profile must be NEW. So who's right, you or Thomas ? :)

Also I suggest the following registry keys:

HKLM\SSYSTEM\CurrentControlSet\Control\Processor
Key: "Capabilities" (dword)
Value: 0007e666
http://support.microsoft.com/kb/2000977

HKLM\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters\
Key: "DisableTaskOffload" (dword)
Value: "1"

http://support.microsoft.com/kb/904946
http://support.citrix.com/article/CTX117491

Regards,

Jonathan Pitre






posted @ Friday, December 10, 2010 3:06 PM by JakeLD


Other tuning options are:

1st) Turn off TCP Offloading (at the NIC AND the OS)

OS:
%SYSTEMROOT%\SYSTEM32\netsh.exe int tcp set global chimney=disabled
%SYSTEMROOT%\SYSTEM32\netsh.exe int tcp set global rss=disabled

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"EnableRSS"=dword:00000000
"EnableTCPChimney"=dword:00000000
"EnableTCPA"=dword:00000000
"DisableTaskOffload"=dword:00000001

2nd) If dealing with APP-V 4.6 64 Bit RDS Client on W2K8R2 this one could be for you [SCCM related]:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SoftGrid\4.5\Client\Configuration]
"RequireAuthorizationIfCached"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SoftGrid\4.5\Client\Network]
"AllowDisconnectedOperation"=dword:00000001
"Online"=dword:00000000
"DOTimeoutMinutes"=dword:ffffff
"LimitDisconnectedOperation"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SoftGrid\4.5\Client\Permissions]
"ToggleOfflineMode"=dword:00000000


3rd)

other optimizations:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"EnablePMTUBHDetect"=dword:00000001
"KeepAliveTime"=dword:00007530
"KeepAliveInterval"=dword:00001388
"TcpMaxDataRetransmissions"=dword:00000005
"EnableBcastArpReply"=dword:00000001
"DisableTaskOffload"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters]
"TreatHostAsStableStorage"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"NtfsDisableLastAccessUpdate"=dword:00000001
"DontVerifyRandomDrivers"=dword:00000001
"NtfsDisable8dot3NameCreation"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters]
"MaxTokenSize"=dword:0000FFFF

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"DelayedDesktopSwitchTimeout"=dword:00000005

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control]
ServicesPipeTimeout"=dword:0001d4c0


[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Browser\Parameters]
"IsDomainMaster"="FALSE"
"MaintainServerList"="No"


---

As always - do NOT use this in a production environment.
Test it in a lab.
Be very careful when touching the autotuning TCP/IP stack. This can backfire.
Talk with the networking gents.

posted @ Thursday, December 16, 2010 4:05 PM by Houser



Jonathan, I made some investigation about HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\UserOverride

And, my result is that your Right about this key, it's not applied anymore on 2008R2

So it's meamn that also HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\ICA-Tcp\UserOverride is not applied any more.

Looking on the Citrix Policy we found a few settings that replace this options like the DragFullWindows options.

I will test, all the options that you post and that are not already in my tips and make an update soon.

Please, if someone found other tuning Tips for 2008R2 / XenApp 6, let us know.

Julien Sybille

posted @ Monday, December 20, 2010 6:01 AM by Julien.sybille


Thank you very much for all tuning tips.

For my test, I've trying to use de three PowerCFG command line, because my servers will going to 100 % CPU, causing by NTDLL.DLL under the svchost without reasons.

With this three command line enter on all Win2K8 R2 servers, this error is not coming back.
For information, we are running all VM on vsphere 4.1.

Very good job,
Best regards,

Xavier TINON

posted @ Monday, December 20, 2010 4:16 PM by Xavier TINON


Julien

Can you give please give us an idea of what you mean when you say you have validated these performance tweaks?

Was it done in a production environment and if so what were the actual benefits ?

What I am getting at is that just adding them to a server in a test environment doesn't really mean much....

Thanks


Hector

posted @ Sunday, January 23, 2011 7:42 PM by worldphoenix


This can also be used to xenserver 5.6 ?

Regard best

Wilson

posted @ Monday, February 07, 2011 8:57 PM by Wilson Mosquera


To respond to your question these tweaks have been applied on a production environment 3 months ago now with XenApp 6 patchs in the same time and it’s running fine. the tweaks have reduces my logon time from 37 seconds to 18-20 s, reduce my CPU usage and avoid my XenApp server hangs (when's applying citrix strategy at user logon for example). Please note that I’ve applied this setting only in one particular client environment, let us know your feedback from your personal test?

Julien

posted @ Monday, February 07, 2011 9:19 PM by Julien.sybille


Wilson I will say this can be tested on xenserver 5.6 on a lab environnement. I don't see any reason why it will not working, but I've never try...

Please let us now your result if you try it ?

julien

posted @ Monday, February 07, 2011 11:06 PM by Julien.sybille


Hi ,

Sorry for my late reply.

I confirm that the CFG command have correcting my 100 % CPU use for all servers in test and production environment.

I ' have seen, that Citrix have developped a hotfix, that fix this 100 CPU by ntdll.dll on "svchost". But I don't have enough time for test it.

Xavier

posted @ Tuesday, February 15, 2011 10:53 AM by Xavier TINON


Hello Julien & Pierre!

Was reviewing this list of items a grabbing a few for a project of mine when I noticed an error in your SuppressionPolicy settings for Windows Explorer optimizations. I think the mistake is when you were entering the values in hex you left a 0 out, so instead of entering 100000 which is 1048576 in decimal you have 10000 which is 65536 in decimal.

Thanks.

Shawn

posted @ Friday, April 22, 2011 4:21 AM by Shawn Bass


Why do all the Explorer tuning tips relate to Windows XP?

All the links I have followed to Microsoft.com refer only to Windows XP or Windows 2000.

posted @ Thursday, July 07, 2011 12:21 PM by Shaun Ritchie


are there any script or tool to backup/set registry values automatically? Thanks.

posted @ Thursday, July 07, 2011 5:49 PM by Learner


You can use REG EXPORT at command prompt or maybe the REGISTRY cmd-let in PowerShell.

You can also use group policy preference to enforce the registry settings and tick "Remove this item when it is no longer applied"

posted @ Monday, July 18, 2011 3:47 PM by Shaun Ritchie


It is recommended to set MaxWorkItems to 4x MaxMpxCt. With MaxMpxCt set to 2048 this would mean MaxWorkItems should be 8192.

I think you might have it back to front because in your article MaxMpxCt is 4x MaxWorkItems.

posted @ Thursday, August 25, 2011 4:09 AM by Scott McKenzie


Only registered users may post comments.