Sunday, January 9, 2011

DFSS, fair-sharing your RDS 2008 R2 environment!

Remote Desktop Services (formally known as Terminal Services) has always been about sharing resources. A single Remote Desktop Server (farm) that all your users can connect to and run their applications on. Sharing resources means less hardware. That does sound great doesn’t it? But what if some users consume so much CPU that it starts to affects other users? You could start isolating these “heavy” users on their own machine or farm, but you lose a lot of flexibility.
In a RDS environment based on Windows Server 2008 you could fairly divide the CPU usage by making use of Windows Server Resource Manager (WSRM). This technique divides CPU-time by watching processes that run on the Remote Desktop Servers and is able to lower the priority of a process when it starts to make heavy CPU usage. So far so good! The only downside is that WSRM is reactive. Meaning that it takes a small amount of time before the priority-change actually kicks in. Although most of the time it’s not more than a few seconds, those few seconds delay could become very annoying to other users when i.e. typing an e-mail.
WSRM also isn’t enabled out of the box. You have to install and configure to let it do its magic. And when you did you could end up with a process used by WSRM that eats away even more of your valuable CPU time J. This bug was fixed by Microsoft though. If you experience this in a RDS 2008 environment see the following kb article: (This is fixed in R2).
In Windows Server 2008 R2 Microsoft introduces Dynamic Fair Share Scheduling (DFSS). A kernel based feature that control CPU allocation. It makes sure that each session is not consuming more than its fair share of CPU time. A proactive solution! And, it’s turned on by default! If you want you can disable it here: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SessionManager\DFSS\EnableDFSS
So when you want your sessions to share the CPU equally, you’re ready to go without any extra configuration!
For more advanced scenario’s you can create different groups of users that you want to give different amount of CPU resources. DFSS is unable to do this; this is where the newly built-in policy called “Weighted_Remote_Sessions” comes in. Using this policy you can define a Premium, Standard and Basic group. As you might have guessed, the Premium group will get more resources than the Standard group and the Standard Group will get more resources than the Basic group. To configure this open the WSRM console, right click the “Weighted_Remote_Sessions” policy and choose properties. Here you can start adding the different AD users or groups (preferably).

When you’re done, configure the policy as the managing policy and you’re done! Little side-note: Setting the “Weighted_Remote_Sessions” policy as the managing policy requires a reboot if this wasn’t already selected as the managing policy.

For more info on WSRM on Windows Server 2008 R2 see here:
Happy fair-sharing!

1 comment:

  1. This is a great feature of Server 2008 R2 and a great article!