QoS (DSCP) settings are not applying on Citrix or RDS

Last week I was confronted with an interesting issue where QoS (DSCP) settings are not applying on Citrix or RDS servers. This is caused by Microsoft's Dynamic Network Fair Share feature. Let me explain.

Contributors: Werner Millich and Lukasz Baszczowski

QoS settings can be configured using a Microsoft group policy. In the example below I set the DSCP value 46 for the executable phonesystem.exe. This setting should be applied to a Citrix worker running on Windows Server 2019.

QoS group policy

However, on a Citrix multi-session worker (and also on a native RDS server), QoS settings are automatically overwritten by the system and assigned the value 0.

You can check the currently effective QoS policies with the following PowerShell command:

Although it is difficult to identify, the result in the screenshot below tells you that there is a problem.

QoS (DSCP) settings are not applying on Citrix or RDS

This becomes clear when you see the result on a machine where the QoS settings are applied correctly:

PowerShell check QoS settings working

A Wireshark trace will show more clearly that the DSCP values are overwritten and set to 0:

QoS (DSCP) settings are not applying on Citrix or RDS

What is behind all this is that QoS settings are overwritten on any Windows operating system that has the Dynamic Network Fair Share feature enabled. And, on a machine that has the Remote Desktop Services role installed, Microsoft's Fair Share technologies are enabled automatically!

Microsoft's Fair Share technologies were introduced in Windows Server 2008 R2:

  1. Fair Share CPU Scheduling
    Dynamically distributes processor time across all Remote Desktop Services sessions on the same RD Session Host server, based on the number of sessions and the demand for processor time within each session.
  2. Dynamic Disk Fair Share
    Balances disk access among the different sessions by balancing disk IO and throttling excess disk usage.
  3. Dynamic Network Fair Share
    Equalizes network consumption among the different sessions using a round-robin approach to allocate bandwidth for each session.

The Fair Share CPU Scheduling feature is probably most known to Citrix administrators since it can be managed using a Microsoft group policy and because Citrix offers its own CPU management capabilities in Workspace Environment Manager.

The other two features can be enabled/disabled by setting a registry value (which can be deployed using a Microsoft group policy preference for example).

To solve our problem we need to disable the Dynamic Network Fair Share feature by setting the registry value EnableFairShare in the registry key HKLM\SYSTEM\CurrentControlSet\Services\TSFairShare\NetFS to 0 (DWORD). I recommend using a group policy preference for this:

  • Action: replace
  • Hive: HKEY_LOCAL_MACHINE
  • Key path: SYSTEM\CurrentControlSet\Services\TSFairShare\NetFS
  • Value name: EnableFairShare
  • Value type: DWORD
  • Value data: 0

Group policy preference to disable dynamic network fair share new

Now the QoS settings are applied correctly. Of course, you have to take into account that disabling Dynamic Network Fair Share means that network traffic is no longer distributed evenly among all sessions on that particular machine.

I hope the information in this article was of some help to you.

Dennis Span on EmailDennis Span on LinkedinDennis Span on Twitter
Dennis Span
Dennis Span
Dennis Span works as a Lead Sales Engineer at Citrix in Vienna, Austria. He holds multiple certifications such as CCE-V, CCIA and CCEA. In 2017, Dennis became a Citrix Technology Advocate (CTA). In 2019, he became a Citrix Technology Professional (CTP). Besides his interest in virtualization technologies and blogging, he loves spending time with his family as well as snowboarding, playing basketball and rowing. He is fluent in Dutch, English, German and Slovak and speaks some Spanish.

Leave a Reply

Your email address will not be published.

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.