How to Tune Up Terminal Services Server for Better Performance


These recommendations are helpful for 32-bit TS servers. However, some of them can be used for the regular 32-bit systems or even for 64-bit ones. Most of the recommendations are based on the information from Microsoft

Paging file

Check the size of physical memory installed in the server. It is recommended to have a paging file 1.5 times bigger than the size of server memory. The article from Microsoft (http://support.microsoft.com/kb/889654) shows how to find the optimal paging file size. Even though this article title mentions 64-bit systems, it mentions both 64- and 32-bit systems.

32-bit system cannot have a paging file bigger than 4 GB. Microsoft advises to use multiply paging files to overcome the limit (http://support.microsoft.com/kb/237740).

The batch file below creates the folder structure for 3 paging files.


C:

CD \

MD PageFiles

CD \PageFiles

MD 1

MD 2

MD 3

You cannot use GUI to set up paging file parameters if you need more than one file.

The location of paging files should be set up in the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

MULTI_SZ: PagingFiles

Pic. 1. Example of paging file configuration for 32-bit system with 8 GB of RAM

Restart is required for this registry value to take effect. After restart you can delete the original paging file located in C:\. It is also a good idea to defragment the paging files with the PageDefrag utility (http://technet.microsoft.com/en-us/sysinternals/bb897426.aspx ) by Mark Russinovich.

Memory Management

The HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management registry key contains many useful parameters. More information about all these value can be found here (http://technet.microsoft.com/en-us/library/cc951698.aspx). The .reg file below sets up the values for the best performance. It is also can be used for 64-bit systems, but the values have to be different.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]

“ClearPageFileAtShutdown”=dword:00000000

“DisablePagingExecutive”=dword:00000000

“LargeSystemCache”=dword:00000001

“NonPagedPoolQuota”=dword:00000000

“NonPagedPoolSize”=dword:00000000

“PagedPoolQuota”=dword:00000000

“PagedPoolSize”=dword:ffffffff

“SecondLevelDataCache”=dword:00000000

“SystemPages”=dword:00001b58

“PhysicalAddressExtension”=dword:00000001

“PoolUsageMaximum”=dword:0000003c

“WriteWatch”=dword:00000001

These changes take effect after restart.

Note: the !VM command of Kernel debugging in WinDbg can show you the kernel memory allocation.

Boot.ini

If the server has more than 4 GB of RAM, use the /PAE switch in boot.ini file to use this memory. This switch makes sense only for 32-bit systems. Look at this article for more information (http://support.microsoft.com/kb/283037 ).

Indexing service

Indexing service is useful to quickly find a file or a folder on a hard drive. Usually this is not necessary on C-drive on Terminal Services server. It is better to disable indexing on TS server hard drives and change the service startup mode to Disabled.

UPHClean

User Profile Hive Cleanup utility is very useful to release the user related part of the registry while a user is logging off. The utility can be found here (http://www.microsoft.com/downloads/details.aspx?familyid=1B286E6D-8912-4E18-B570-42470E2F3582&displaylang=en ) (version 1.6d) or here (http://blogs.technet.com/uphclean/archive/2008/02/28/uphclean-v2-0-beta.aspx ) (version 2.0.48 beta)

Antivirus

Include the following folders into your antivirus exception list

  • Paging file location(s)
  • C:\Program Files\UPHClean
  • C:\Windows\System32\Spool

Add the Uphclean.exe process into exception list

Checklist for Terminal Services server tune-up

  • Calculate paging file size
  • Create paging file folder structure and set up PageFiles registry value
  • Set up memory management registry values
  • Add /PAE switch to Boot.ini file if necessary
  • Restart the server
  • Defragment paging file(s)
  • Restart the server
  • Stop and disable Indexing Service
  • Install UPHClean
  • Change antivirus exception list
  • Restart the server
Advertisements

One Response to How to Tune Up Terminal Services Server for Better Performance

  1. […] was working slowly sometimes and could hang for a while for some users. The tuning I described here was already […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: