Load Balancing Remote Desktop Services

Remote Desktop Services (RDS), known as Terminal Services in Windows Server 2008 and earlier, is one of the components of Microsoft Windows that allows a user to take control of a remote computer or virtual machine over a network connection. RDS is Microsoft's implementation of thin client, where Windows software and the entire desktop of the computer running Remote Desktop Services, are made accessible to a remote client machine that supports Remote Desktop Protocol.

The fundamental purpose of deploying a load balancer is to share the load from multiple clients between two or more back-end Remote Desktop Servers. Typically, all Remote Desktop Servers within the cluster/farm have the same applications installed to ensure all clients get the same applications irrespective of which server they are connected to. The default TCP port used is 3389, although this can be changed if required via the Windows Registry.

We've been using our Enterprise Clustered Pair to run a Microsoft Remote Desktop Services farm for 4 years with no problems.
Matthew Abrahams - All3Media

An important aspect of load balancing Remote Desktop Servers is persistence. This relates to the ability to reconnect to disconnected sessions that occur when client sessions are closed rather than logged off. If this reconnection process is not handled correctly, users may not be able to return to their previous sessions. The following persistence methods are available:

IP Persistence
This is our recommended method and can be used in most cases. It does rely on each client having a unique IP address, so if clients connect via some form of NAT device, this may not work (since the source IP address for all clients may be the same).

Microsoft Connection Broker
Connection Broker provides functionality that allows a group of Remote Desktop Servers to coordinate the reconnection of disconnected sessions. All sessions are stored as records in a central database. This database is updated and queried by the Remote Desktop Servers whenever users log on, log off, or disconnect their session while leaving their applications active.

The load balancer is able to interact with Connection Broker by enabling Routing Token Redirection mode. This mode allows the reconnection of disconnected sessions by utilizing a routing token to enable the load balancer to re-connect the client to the correct Server.

RDP Cookies
This method utilizes the cookie sent from the client in the initial Connection Request PDU. This cookie is created when the username is entered at the first client login prompt (mstsc.exe). If the username is not entered here, the cookie is not created. NOTE: This method is not generally recommended. Please refer to this blog post for further information.

When using IP based persistence, Layer 4 methods are generally recommended to allow maximum performance. When Connection Broker based persistence is used, Layer 7 SNAT mode is required to enable interaction with the routing token. Please refer to our full Microsoft Remote Desktop Services Deployment Guide for further information.

The entire Loadbalancer.org ENTERPRISE product range supports load balancing Microsoft Remote Desktop Services / Terminal Services and starts from as little as $1,495

Please see our full Microsoft Remote Desktop Services Deployment Guide for further information.