One of the new features within Remote Desktop Services in Windows Server 2012 is Fair Share of Resources. Actually Fair Share was already introduced in Windows Server 2008R2 but the feature is extended in Windows Server 2012. In this article I will describe how Fair Share of Resources is functioning, what can be configured and how it works in practice.
What is FairShare on Resources?
In Windows 2008R2 Microsoft introduced Dynamic Fair Share Scheduling (DFSS). In Windows 2008R2 this was only available for CPU. The feature offers dynamically distributed processor time across the (active) sessions. The process will do this based on active sessions and load within these sessions. Microsoft is stating that this part is improved in Windows Server 2012, but there is not further information available (as far I can find out) what the actual improvements are.
New in RD Session Host in Server 2012 is the addition of FairShare for Network and Disk. So besides CPU the RDS server is also load balancing disk resources and network bandwidth. Just as for the CPU the load is distributed equally across the sessions running on the servers. All those three options have as goal to prevent excessive resource usage by one user and provide all users the same experience. However FairShare techniques do not ensure that resources are not exhausted, this can be still the case. If all users are using all CPU resources, FairShare only ensures that all users will get some CPU capacity but it can be still that all processors are at 100% usage and users experience a degraded performance.
The technique used in Windows Server 2012 is the same as in Windows Server 2008R2. It’s based on a filter driver (tsfairshare.sys) and is enabled by default. Configuration of the Fair Share mechanism is really basic. Via Group Policy Management you can disable the CPU Fair Share functionality (Windows-Components/Remote Desktop Session Host/Connections). I did not find similar GPO settings for disabling the network and disk fair share functionality.
However there are some additional registry keys available, to disable this functionality (HKLM\System\CurrentControlSet\Services\TSFairShare). Don’t know if we can use that in this way. Personally I would like to see that the disable of this functionality will become available as a GPO setting.
Unfortunate you cannot do any tuning or set priorities. This is actual logical because it’s called FairShare and if set different priorities it’s not Fair Share anymore. In Windows 2012 you can you still use Windows System Resource Manager (WSRM) to accomplish that. However WSRM is depreciated in Windows Server 2012, so it won’t be available in a new version of Windows Server. Unfortunate there is no alternative available yet within Windows Server for WSRM.
Fair Share in Practise
To show the Fair Share we need to have some high resources. To show the working of FairShare I used the CPUstress tool created by Tim Mangan (in his famous CribbTools box). With this tool you can cause excessive CPU resource usage. I just logged in with two users on the RDS server and started the utility with the first user and configured it to use lots of CPU. You will see this in the below shown figure. On the left you will see that the first user vanbragtest1 the only one is using a high CPU by the CPUstress application. As you can see FairShare is not preventing high CPU usage, because the vanbragttest1 user is the only requiring CPU resources he get all the CPU resources required/available. On the right you will see that the second test vanbragttest2 also starts the CPUstress application and is also demanding CPU access. FairShare kicks in and provides both testaccounts the same amount of CPU resources.
With FairShare of Resources in RD Session Host Microsoft implemented a nice functionality. It’s cool Microsoft extended the functionality with Network and Disks, but personally I think most companies will use the CPU FairShare the most. FairShare of Resources only ensures that users get equally access to resources. It won’t accomplish that resources can be fully used, so 100% CPU usage is still possible. It’s a pity that for those companies who doesn’t want to use the technique (which is enabled by default) can only disable CPU via the Group Policy Management. It looks like the new functionality cannot be disabled via GPO’s at this moment. Summarized FairShare of Resources does where it’s build for. If the offered functionality is good enough for your organization depends on several factors like the requirements of your organization and the way your applications are working.