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 ( 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 (

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


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 ( ) 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 ( 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]













These changes take effect after restart.

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


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 ( ).

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.


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 ( ) (version 1.6d) or here ( ) (version 2.0.48 beta)


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

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: Logo

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: