As IT professionals, we know that managing resources in multi-user environments is essential for ensuring a consistent and high-quality experience for all users. In Windows Server Remote Desktop Session Host (RDSH) environments, Fair Share is a feature that automatically allocates resources like CPU, disk, and network bandwidth among multiple users based on current demand, ensuring that no single session can monopolize system resources. This article dives into the mechanics of Fair Share, discusses the implications of enabling or disabling it, and provides step-by-step instructions for configuring Fair Share through registry settings, Group Policy (GPO), and PowerShell.
What is RDSH Fair Share?
Fair Share is a feature introduced by Microsoft in Windows Server to manage system resources effectively in Remote Desktop Services (RDS) environments. Its purpose is to ensure that resources—CPU, disk I/O, and network bandwidth—are dynamically allocated based on active sessions’ needs. By leveling out resource access, Fair Share helps prevent situations where resource-heavy applications used by one user degrade the performance of other users’ sessions.
Key Components of RDSH Fair Share
- CPU Fair Share: Distributes CPU time among active sessions to prevent any one session from consuming too much processing power.
- Disk Fair Share: Controls disk I/O distribution so that one user’s operations (e.g., reading and writing files) don’t excessively impact others.
- Network Fair Share: Allocates network bandwidth based on session demands, ensuring no single session monopolizes the network resources.
Implications of Enabling or Disabling Fair Share
Understanding the impact of enabling or disabling each component is crucial for optimizing your RDS environment:
1. CPU Fair Share
- Enabled: CPU usage is distributed based on demand, which benefits environments with high concurrent user activity by ensuring consistent performance.
- Disabled: Disabling CPU Fair Share allows CPU resources to be allocated without restriction, which may benefit applications requiring extensive CPU time. However, it risks performance degradation for other users in resource-intensive scenarios.
2. Disk Fair Share
- Enabled: Disk I/O is evenly allocated, useful in scenarios where multiple users may perform read/write operations concurrently. It helps avoid performance bottlenecks.
- Disabled: Disabling Disk Fair Share can enhance the performance of disk-heavy applications but may result in degraded performance for other users if a few sessions monopolize disk access.
3. Network Fair Share
- Enabled: Network bandwidth is distributed fairly, which is ideal for environments with high network utilization. Users get a balanced network experience even during peak usage.
- Disabled: Disabling Network Fair Share might be suitable for bandwidth-heavy applications, but it can lead to congestion and inconsistent network experiences across user sessions.
In general, enabling Fair Share across resources supports environments with unpredictable, diverse user activities. However, for specialized applications or controlled usage scenarios, selectively disabling Fair Share may offer performance benefits.
Configuring RDSH Fair Share
Fair Share settings can be controlled via the Windows Registry, Group Policy Objects (GPO), and PowerShell commands.
1. Configuring Fair Share via Registry
To manage Fair Share settings through the Registry:
- Navigate to the following registry path:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SessionManager\RDSessionHost\FairShare
- Enable or disable individual Fair Share settings:
- CPU Fair Share: Create a
DWORD
value namedCpuFairShare
. - Disk Fair Share: Create a
DWORD
value namedDiskFairShare
. - Network Fair Share: Create a
DWORD
value namedNetworkFairShare
.
- CPU Fair Share: Create a
- Set each value as follows:
- 1: Enable Fair Share for the specified resource.
- 0: Disable Fair Share for the specified resource.
For example, to enable CPU and Disk Fair Share but disable Network Fair Share:
CpuFairShare = 1
DiskFairShare = 1
NetworkFairShare = 0
Note: Changes take effect after a system restart.
2. Configuring Fair Share via Group Policy (GPO)
For environments managed through GPO, you can control Fair Share settings with Group Policy as follows:
- Open the Group Policy Management Console (GPMC) and navigate to:
Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Connections
- Enable or disable each resource’s Fair Share by adjusting the following policies:
- Enable Fair Share CPU Scheduling
- Enable Fair Share Disk Allocation
- Enable Fair Share of Network Bandwidth
- Setting Options:
- Enabled: Activates Fair Share for the respective resource.
- Disabled: Deactivates Fair Share for the respective resource.
Apply the Group Policy to the appropriate Organizational Unit (OU) containing your RDSH servers, then run gpupdate /force
to immediately apply changes, or allow the next policy refresh to apply them automatically.
3. Configuring Fair Share via PowerShell
PowerShell provides a quick way to modify Fair Share settings on an RDSH server. Here’s how to enable or disable Fair Share settings:
- Enable or disable CPU Fair Share:
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\SessionManager\RDSessionHost\FairShare' -Name 'CpuFairShare' -Value 1 # Enable Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\SessionManager\RDSessionHost\FairShare' -Name 'CpuFairShare' -Value 0 # Disable
- Enable or disable Disk Fair Share:
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\SessionManager\RDSessionHost\FairShare' -Name 'DiskFairShare' -Value 1 # Enable Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\SessionManager\RDSessionHost\FairShare' -Name 'DiskFairShare' -Value 0 # Disable
- Enable or disable Network Fair Share:
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\SessionManager\RDSessionHost\FairShare' -Name 'NetworkFairShare' -Value 1 # Enable Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\SessionManager\RDSessionHost\FairShare' -Name 'NetworkFairShare' -Value 0 # Disable
To confirm the settings, use Get-ItemProperty
with the same path to verify the current Fair Share configuration.
Best Practices for Fair Share in RDS Environments
- Assess Resource Needs: Identify whether resource competition is an issue in your environment. In most cases, enabling Fair Share ensures balanced performance, but specific applications may benefit from a customized configuration.
- Test Performance: Before disabling Fair Share on production servers, run tests in a controlled environment to monitor the impact on application performance and user experience.
- Regularly Monitor: Resource demands can change as applications and user needs evolve. Regularly monitor performance and tweak Fair Share settings as needed.
Conclusion
RDSH Fair Share is a valuable tool for balancing resource usage in multi-user environments, offering a flexible approach to CPU, disk, and network resource allocation. By understanding its implications and configuration options, you can optimize resource distribution to fit your specific use case, ensuring stable and consistent performance for all users.