Optimizing Performance: Resource Fair Sharing in Windows Server Remote Desktop Services (RDS)

A prevalent challenge with terminal servers that accommodate multiple users is the potential for one user to initiate a resource-heavy process, which can severely impact the performance of others. For instance, when a single user launches a process consuming over 90% of the CPU, it can render the server nearly unusable for other users.

To address this issue, Windows Server with the Remote Desktop Services (RDSH) role, along with Windows 10/11 Enterprise multi-session environments, offers the Dynamic Fair Share Scheduling (DFSS) feature. DFSS ensures that server computing resources are allocated fairly among user sessions, preventing any singular session from dominating CPU, disk, or network resources, thus maintaining overall performance balance.

DFSS is accountable for managing the following resources:

  • CPU Fair Share: This feature evenly distributes CPU time amongst sessions based on the number of active sessions and the CPU usage of each, preventing one user from monopolizing resources.
  • Disk Fair Share: It allocates storage bandwidth for I/O operations among users, ensuring equitable access.
  • Network Fair Share: It divides the available bandwidth of the network interface among sessions in a round-robin fashion.

While DFSS provides robust control over resource distribution, it does not manage RAM allocation among user sessions.

Initially introduced in Windows Server 2008 R2, DFSS focused solely on CPU resource scheduling. From Windows Server 2012 onward, its functionality expanded to include network throughput and disk I/O balancing as well.

In Windows Server 2016 and newer versions, DFSS is automatically enabled when the RDSH role is installed, but it is mostly focused on CPU resource management by default. If one user consumes excessive CPU time, DFSS can automatically curtail their allocation, thereby freeing resources for other users.

To verify whether DFSS is activated, the following PowerShell command can be executed:

(gwmi win32_terminalservicesetting -N "rootcimv2terminalservices").enabledfss

This command will return 1 if DFSS is enabled and 0 if it’s not.

Additionally, administrators can manage DFSS through Group Policy. The policy named Turn off Fair Share CPU Scheduling can be located in the Group Policy settings under Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Connections.

By default, CPU Fair Share is enabled for Windows Server RDS and Windows Enterprise multi-session setups, though Dynamic Disk Fair Share and Dynamic Network Fair Share are disabled until manually activated. Administrators can use the registry to check and modify the EnableCpuQuota, EnableFairShare parameters for disk, and network resources.

To enable these features, the following PowerShell commands can be used:

  • Enable Fair Share CPU Scheduling:

    $temp = (gwmi win32_terminalservicesetting -N "rootcimv2terminalservices")$temp.enableDFSS = 1$temp.put()
  • Enable Dynamic Disk Fair Share:

    $temp = (gwmi win32_terminalservicesetting -N "rootcimv2terminalservices")$temp.enableDiskFSS = 1$temp.put()
  • Enable Network Fair Share:

    $temp = (gwmi win32_terminalservicesetting -N "rootcimv2terminalservices")$temp.enableNetworkFSS = 1$temp.put()

To disable these features, one simply needs to set their values to 0.

While DFSS plays a crucial role in distributing resources effectively, it might be necessary to disable it in specific scenarios where it does not align with user application performance needs, as it could lead to throttling that hampers workload efficiency.


Tags: