Performance issues due to Inactive Terminal Server Ports

Performance issues due to Inactive Terminal Server Ports

  • Comments 23
  • Likes

Good morning AskPerf!  There are several issues that have been associated with a high number of inactive Terminal Server ports.  Delayed logon times to RDP sessions, failure of printers to redirect, and slow server performance due to registry bloat from all the ports. These inactive TS ports accumulate because the Remote Desktop Services Device Redirector service creates a new port every time an RDP session is established, but the ports are not always recycled.  Every RDP session can possibly create a new port, and every ended session means a new inactive port. Performance degradation is known to occur when 250 or more TS ports exist in the registry. Increasingly large numbers of redirected devices will exacerbate performance delays.

To eliminate any issues these TS ports may cause, we have a new Windows Server 2008 R2 hotfix.  The Hotfix can be downloaded here - KB 2655998 Long logon time when you establish an RD session to a Windows Server 2008 R2-based RD Session Host server if Printer Redirection is enabled.  This hotfix will prevent inactive TS ports from accumulating in the future, but you also have to clean up any currently inactive TS ports using the Fixit tool included in KB2655998.  The FixIT tool itself can also be downloaded directly from http://go.microsoft.com/?linkid=9799054.  The FixIt tool will remove the entries already accumulated under the TS ports registry key below:

[HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\{28d78fad-5a12-11d1-ae5b-0000f803a8c2}\##?#Root#RDPBUS#0000#{28d78fad-5a12-11d1-ae5b-0000f803a8c2}]

Because the Hotfix and the FixIt perform two different functions, you must install the Hotfix and run the FixIt one time on your 2008 R2 Remote Desktop Server. 

For down-level operating systems such as Server 2003, Server 2008 Terminal Servers and Windows 7 in a VDI scenario, we highly recommend a scheduled task be created to execute the Inactive TS Port FixIt on a bi-weekly basis, since the hotfix only supports Windows Server 2008 R2 at this time.

The FixIt is an MSI package so you can run it silently with no user interaction required.  Follow these simple steps:

1. Locate the MSI file in Windows Explorer and note the exact path to it

2. Click Start and type in the following:

msiexec /package “path” /quiet

For example, if the MSI file MicrosoftFixit50833.msi is located in the “temp” folder of your C drive, then the path would be C:\temp\MicrosoftFixit50833.msi and the command would look like this:

msiexec /package “C:\temp\MicrosoftFixit50833.msi” /quiet

3. To add logging and check the results, use this command:

msiexec /package "c:\temp\MicrosoftFixit50833.msi" /quiet /log c:\temp\MSI50833.log

Additional Resources

-Jess Cunningham

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Simply superb! This is what we looking for .

  • Thank you for the post.  Does this issue occur if the majority of the connections are through Citrix?

  • Thank you for the post.  Does this fix pertain to servers where the majority of the connections are through Citrix and not RDP?  

  • Does this apply to servers where the majority of connections are through Citrix?  Thank you.

  • Please check the number of entries under [HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\{28d78fad-5a12-11d1-ae5b-0000f803a8c2}\##?#Root#RDPBUS#0000#{28d78fad-5a12-11d1-ae5b-0000f803a8c2}].  

    If there are more than 200 then suggest to install the hotfix and run the FixIT to remove any entries and prevent further accumulation of TS Inactive Ports.

  • Is the post by jdickson289 suggesting that issues occur if the count of ports in general gets above 200?

  • jdickson289's comment about 200 entries under the reg key suggests that this is a limitation of the OS.  Is this correct?

  • Marc,

    200 is not a hard limit - it's an indicator of a potential problem that should be addressed with the FixIT and hotfix to prevent a problem in the future.

  • Hotfix aside, what is the expected behavior of registry key in question? When no one is logged in should there be no subkeys, etc? Is the issue that the subkeys are not properly being purged at logoff?

  • Patrick the keys don't get purged and will accumulate into the thousands depending on how many users you have running on the Terminal Server.  This is a very old issue that goes back to Server 2000 and maybe earlier.  As Blake said above every time a TS session starts and Client Printing is Turned on (Now called Windows Printer Redirection) these will be created.  If you use Network Printing only in the Terminal Server Environment they do appear (Now shown as Windows Printer with a check box DISABLE under RDP-TCP Properties for the Terminal Services Configuration.  In Server 2000 when we first saw this issue 12 years ago we would manual clean them out and delete all the keys. If you shut off Client printing (Disable in Server 2008) I think they will never return.  These days many people work from home and so turning on Client Printing “Windows Printer Redirection” in Terminal Server these days is generally set on.  When it is turned on as an example a 2008 server with 80 users can create about 600 entries in a day or two even if most of the users run Network Printers and don’t have a client printer the entries are still made.  One day we estimated a server to have had 24,000 entries.  Its important to use the fix listed on this page.

  • Scott if you are running Citrix it uses the Microsoft Backbone of Terminal Server.  Citrix no longer can use the CODE for controls of the OS as per agreement back in the Early 90’s. This was after Terminal Server 4.0.  Again if Client Printing is set on “now Called Printer Redirection” these will accumulate.  If you use Graphon’s GO-GLOBAL www.graphon.com they have there own Server source Code which does not interface with any of the Windows Terminal Server Code like Citrix.  This is one of the only Cloud Based software’s I know of that has written all of their own source code and so printing is done differently on that platform. As Jdickson289 has suggested open the registry and review the number of key entries accumulated for a definitive answer.  Citrix does create there own HOT Fixes separate from Microsoft to address some of these issues.

  • On my Windows 2008 R2 SP1 TS ports registry appear under:

    HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\{28d78fad-5a12-11d1-ae5b-0000f803a8c2}\##?#Root#SYSTEM#0001#{28d78fad-5a12-11d1-ae5b-0000f803a8c2}

    so FixIt tool doesn't remove anything for me.

  • Is it safe to run this fix while users are logged in?

  • @Steve Boer:  Yes, it is safe to run while users are logged on as it only removes the inactive ports, not those currently in use.

  • hi. at my work place we have windows 2003 server, and i have a lot of problems becouse print spool blocks RDP connections, and best i can do is to stop spoolsv and restart it. but problems occurs again in some hours. anything to do? i think this problem appeared when i installed a new hp printer "HP Officejet 6000 E609a Series". Sincer then i always have this problem. any optimal solution to solve this? Thanx!