Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Virtualization / Hyper-V / Poor Network Performance on Hyper-V VMs in Windows Server 2019

February 20, 2023 Hyper-VPowerShellVirtualizationWindows Server 2016Windows Server 2019

Poor Network Performance on Hyper-V VMs in Windows Server 2019

Several times I came across a situation when files were copied much slower from/to virtual machines on a Hyper-V host running Windows Server 2019 than in a VM of the same configuration on a host running Windows Server 2016. In some tests, the read/write speed over the network to VM on Windows Server 2019 is almost three times lower than that on WS2016 (copying over SMB, SSH/SCP was tested). In this article, I tried to describe several different methods to improve the network performance of Hyper-V virtual machines running on Windows Server 2019 (and the latest Windows 10 and 11 builds).

Receive Segment Coalescing (RSC) in the Hyper-V vSwitch

First of all, you should note the Receive Segment Coalescing (RSC) feature that appeared in Hyper-V on Windows Server 2019/2022 (and Windows 10 1809+). The Receive Segment Coalescing is used at the virtual switch level (vSwitch). RSC allows to reduce CPU load and increase network throughput by combining multiple TCP segments into larger ones. Network performance is improved because large segments are processed faster than many smaller ones.

In previous Hyper-V versions (Windows Server 2016/2012R2), only hardware Receive Segment Coalescing mode was supported at the NIC level.

If RSC support is enabled, it may result in extra network delay in some hardware configurations.

The issue occurs both in Windows Server 2019 Full GUI versions and in free Windows Hyper-V Server.

By default, RSC is enabled for all external vSwitches on Windows Server 2019.

You can check if RSC is enabled for virtual switches using the command:

Get-VMSwitch | Select-Object *RSC*

You can disable using RSC for IPv4 traffic on the client network adapter using the following command:

Disable-NetAdapterRsc -Name "Ethernet" -IPv4

Check if the copy speed in a Hyper-V VM has increased after disabling RSC. If the network speed has improved, you can disable RSC on the virtual switch the VM is connected to.

You can check your network throughput using the iperf tool.

To disable software RSC for a specific virtual switch, run the command:

Set-VMSwitch -Name vSwitchName -EnableSoftwareRsc $false

check if RSC is enable on hyper-v switch

You can enable/disable RSC on the fly, it won’t affect any active connections.

Or you can completely disable RSC on your Windows host:

netsh int tcp set global rsc=disabled

Virtual Machine Queue (VMQ) Mode in Network Adapter Driver

In some cases, if VMQ (Virtual Machine Queue) is enabled in a network adapter driver of a physical Hyper-V host, it may result in poor network performance in Hyper-V virtual machines. VMQ is a hardware feature and if it is not supported by your hardware but enabled in the driver, it can result in packet loss and increased network latency. The problem is typical to Broadcom Gigabit network adapters and occurs in all Hyper-V versions (Windows Server 2012 R2/2016/2019).

VMQ is designed to improve network performance by directly forwarding packets from a physical network adapter to virtual machines.

You can disable VMQ in the properties of your network adapter driver.

disable VMQ (Virtual Machine Queue) in NIC driver settings

Or you can display a list of network adapters with VMQ support and their status using PowerShell:

Get-NetAdapterVmq

To disable VMQ for a specific NIC, run the command below (the network adapter will be unavailable for a couple of seconds):

Set-NetAdapterVmq -Name “NICName” -Enabled $False

check if vmq is enabled in NIC - powershell

After disabling VMQ, it is better to restart the host and check the network performance.

Make sure that QoS bandwidth limit policies are disabled in Windows.

Optimize TCP Settings for Hyper-V on Windows Server 2019

Save the current TCP settings on your Hyper-V host and apply new settings that will make TCP settings in Windows Server 2019 almost similar to those of Windows Server 2016.

Save the current settings:

Get-NetTCPSetting -SettingName Datacenter,DatacenterCustom,InternetCustom,Internet|select SettingName,CongestionProvider,CwndRestart,ForceWS|Export-csv c:\backup\ws2019_network_stack_settings_nettcp_backup.csv

By default in Windows Server 2019 and Windows 10 1709+, the CUBIC implementation of TCP is used. This algorithm is optimized for high-speed networks with high latency (it is also used by default in Linux kernel 2.6.19 and newer).

Windows TCP stack on Windows Server 2019 based on CUBIC

Apply the following settings only in Windows Server 2019 or Hyper-V 2019.

Apply new NetTCP settings for LAN:

Set-NetTCPSetting -SettingName DatacenterCustom,Datacenter -CongestionProvider DCTCP
Set-NetTCPSetting -SettingName DatacenterCustom,Datacenter -CwndRestart True
Set-NetTCPSetting -SettingName DatacenterCustom,Datacenter -ForceWS Disabled

For WAN:

Set-NetTCPSetting -SettingName InternetCustom,Internet -CongestionProvider CTCP
Set-NetTCPSetting -SettingName InternetCustom,Internet -DelayedAckTimeoutMs 50
Set-NetTCPSetting -SettingName InternetCustom,Internet -ForceWS Disabled

Disable network RSS and RSC network optimization methods at the TCP stack level:

netsh int tcp show global
netsh int tcp set global RSS=Disabled
netsh int tcp set global RSC=Disabled

or on the NIC level:

Get-NetAdapter | Set-NetAdapterAdvancedProperty -DisplayName "Recv Segment Coalescing (IPv4)" -DisplayValue "Disabled" -NoRestart
Get-NetAdapter | Set-NetAdapterAdvancedProperty -DisplayName "Recv Segment Coalescing (IPv6)" -DisplayValue "Disabled" -NoRestart
Get-NetAdapter | Set-NetAdapterAdvancedProperty -DisplayName "Receive Side Scaling" -DisplayValue "Disabled" –NoRestart

Disable vRSS for all VMs:

Get-VM | Set-VMNetworkAdapter -VrssEnabled $FALSE

Disable Large Send Offload (LSO) on NICs:
Get-NetAdapter | Set-NetAdapterAdvancedProperty -DisplayName "Large Send Offload Version 2 (IPv4)" -DisplayValue "Disabled" -NoRestart
Get-NetAdapter | Set-NetAdapterAdvancedProperty -DisplayName "Large Send Offload Version 2 (IPv6)" -DisplayValue "Disabled" -NoRestart
Get-NetAdapter | Restart-NetAdapter

You can also disable these options in the Advanced tab of your network adapter properties:

  • Recv Segment Coalescing (IPv4/IPv6) = Disabled
  • Large Send Offload V2 (IPv4/IPv6) = Disabled

disable recv segment coalescing on hyper-v

These TCP stack settings will make Windows Server 2019 network protocol settings similar to those of previous Windows Server versions.

6 comments
6
Facebook Twitter Google + Pinterest
previous post
Enter-PSSession: Running Remote Commands in Interactive Shell
next post
Configuring KMS License Server for Office 2021/2019/2016 Volume Activation

Related Reading

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

October 15, 2023

Reset Root Password in VMware ESXi

October 12, 2023

How to Query and Change Teams User Presence...

October 8, 2023

6 comments

Jérôme Sporbert February 22, 2022 - 1:52 pm

I am a customer engineer at Microsoft working on Hyper-V, Azure Stack HCI,…
if you want to improve Network Performance for your Hyper-V, you should follow our official recommendations:

https://techcommunity.microsoft.com/t5/networking-blog/synthetic-accelerations-in-a-nutshell-windows-server-2019/ba-p/653976

In this article , you are basically disabling every Network Optimization.

A simple file copy is not a representative way to test Network Performance as it is mainly mono-threaded, thus you could possibly not take advantage of vRSS / RSS basically.

Reply
serg March 2, 2022 - 6:09 pm

Microsoft introduced a new feature in Server 2019 called “Receive Segment Coalescing” (RSC).
Apparently it is used for offloading tasks from the CPU to the network card. It strips the headers from packets and combines the payload of those into one packet.
It is enabled by default on all vSwitches on Windows Server 2019. Of course it doesn’t work and just causes problems on some hardware configurations.

Reply
C May 16, 2022 - 5:13 am

Thank you so much! Disabling RSC seems to solve an issue that’s being bugging our CAD users!

Reply
ada August 16, 2022 - 12:56 pm

Thank you! You saved me from buggy SMB tcp dup ack and retransmissions!

Reply
ManuC December 21, 2022 - 12:02 am

thank you, I applied the change in the network card as explained in the “Virtual Machine Queue (VMQ) Mode in Network Adapter Driver” and now it works like a charm!, before this, the maximum speed of transfer was about 10Kb/s 😊

Reply
Justin September 11, 2023 - 5:25 pm

Thank you so much for this! My host is capable of 1150Mbps down and 45Mbps up (Spectrum). Sandbox and VMs were only getting 3Mbps down and 45Mbps up. What? I then later discovered this only happens on my 10Gb NIC. Full speed on my 1Gb NIC. What? Disabling RSC fix it. Even more confusing, iperf was always full speed between client and host. It was just internet that was degraded. This was happening on Win11.

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023
  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Hyper-V Virtual Machine Stuck in Stopping/Starting State
  • How to Install Windows 11 on a Hyper-V Virtual Machine
  • How to Install and Configure Free Hyper-V Server 2019/2016
  • USB Device Passthrough (Redirect) to Hyper-V Virtual Machine
  • Windows Cannot Find the Microsoft Software License Terms
  • How to Install VMWare ESXi in a Hyper-V Virtual Machine?
  • Import, Export and Clone Virtual Machines in Hyper-V
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top