Blog

This article addresses the issue of reduced file transfer speeds over the network on virtual machines (VMs) running on Hyper-V with Windows Server 2019. Often, network transfer speeds on these VMs are significantly lower compared to similar configurations on Windows Server 2016 hosts. In some tests, network read and write speeds on VMs in Windows Server 2019 can be up to three times slower than in WS2016 (tested with SMB and SSH/SCP file transfers). We have compiled various methods to improve network performance for Hyper-V VMs on Windows Server 2019 and the latest Windows 10 builds.

You can purchase original Windows Server product keys from our catalog:

Windows Server 2022 – from 28.00 €

Windows Server 2019 – from 16.90 €

Receive Segment Coalescing in Hyper-V 2019

The first aspect to consider is the Receive Segment Coalescing (RSC) technology, introduced in Hyper-V on Windows Server 2019/2022 (and Windows 10 starting with build 1809). Receive Segment Coalescing operates at the virtual switch (vSwitch) level, reducing CPU load and increasing network throughput by combining multiple TCP segments into fewer, larger segments. This improves network performance, as processing fewer large segments is more efficient than handling many small ones.

In previous Hyper-V versions on Windows Server 2016/2012 R2, only hardware-based RSC was supported at the network adapter level. Enabling RSC can sometimes cause additional network latency in certain hardware combinations.

Problem

The issue appears in both the full version of Windows Server 2019 with a graphical interface and the free Windows Hyper-V Server edition. By default, RSC is enabled for all external (External) vSwitches in Windows Server 2019.

To check if RSC is enabled for virtual switches, use the command:

Get-VMSwitch | Select-Object *RSC*

You can disable RSC for IPv4 traffic at the client network adapter level:

Disable-NetAdapterRsc -Name "Ethernet" -IPv4

Test whether disabling RSC improves file transfer speeds on Hyper-V VMs. If network performance improves, it’s recommended to disable RSC on the virtual switch connected to the VM.

You can measure network throughput using the iperf utility.

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

Set-VMSwitch -Name vSwitchName -EnableSoftwareRsc $false

Enabling or disabling RSC can be done on the fly without affecting active connections.

You can also completely disable RSC on the host:

netsh int tcp set global rsc=disabled

VMQ Mode in Network Adapter Driver

In some cases, enabling the Virtual Machine Queue (VMQ) option in the network adapter driver on the Hyper-V host can lead to low network performance in Hyper-V VMs. This occurs because VMQ is a hardware feature, and if it’s enabled in the driver but not supported by the hardware, it causes packet loss and increased network latency. This issue is common with Broadcom Gigabit network adapters and affects all Hyper-V versions on Windows Server 2012 R2/2016/2019.

VMQ is designed to improve network performance by directly transferring packets from the physical network adapter to VMs.

You can disable VMQ in the network adapter driver properties.

You can also list network adapters with VMQ support and their status using PowerShell:

Get-NetAdapterVmq

To disable VMQ for a specific adapter (the adapter will be unavailable for a few seconds):

Set-NetAdapterVmq -Name "NICName" -Enabled $False

After disabling VMQ, reboot the host and recheck network performance.

Ensure that no QoS policies restricting network speed are applied in Windows.

Optimizing TCP Protocol Parameters for Windows Server 2019 Hyper-V

Save the current TCP settings on the Hyper-V host and apply new settings to align the TCP protocol parameters in Windows Server 2019 with those in Windows Server 2016.

Save Current Settings

Get-NetTCPSetting -SettingName Datacenter,DatacenterCustom,InternetCustom,Internet | Select SettingName,CongestionProvider,CwndRestart,ForceWS | Export-Csv c:\ps\nettcp_backup.csv

In Windows Server 2019 and Windows 10 1709+, the default TCP implementation is CUBIC. This algorithm is optimized for high-speed networks with high latency (also used in Linux kernels starting from version 2.6.19).

Warning: The following settings should only be applied to Windows Server 2019 or Hyper-V 2019.

Apply new settings for LAN networks:

Set-NetTCPSetting -SettingName DatacenterCustom,Datacenter -CongestionProvider DCTCP

Set-NetTCPSetting -SettingName DatacenterCustom,Datacenter -CwndRestart True

Set-NetTCPSetting -SettingName DatacenterCustom,Datacenter -ForceWS Disabled

For WAN networks:

Set-NetTCPSetting -SettingName InternetCustom,Internet -CongestionProvider CTCP

Set-NetTCPSetting -SettingName InternetCustom,Internet -DelayedAckTimeoutMs 50

Set-NetTCPSetting -SettingName InternetCustom,Internet -ForceWS Disabled

Disable network optimization techniques RSS and RSC 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 at the network adapter 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 virtual machines:

Get-VM | Set-VMNetworkAdapter -VrssEnabled $FALSE

Disable the Large Send Offload (LSO) feature on network adapters:

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

These options can also be disabled in the network adapter properties on the Advanced tab:

Recv Segment Coalescing (IPv4/IPv6) = Disabled

Large Send Offload V2 (IPv4/IPv6) = Disabled

Applying these TCP stack settings will align the network protocol parameters of Windows Server 2019 with those of previous Windows Server versions, potentially improving network performance.

By following these recommendations, you can enhance the network performance of Hyper-V virtual machines on Windows Server 2019 and minimize issues related to low network data transfer speeds.

banner for Windows Server 2022
Buy Windows Server 2022 product key from
27.00 € Find Out More
Subscribe
Notify of
guest
0 comments
Newest
Oldest
Inline Feedbacks
View all comments