The speed of the router on Linux drops after virtualization Hyper-V

pznosko

New Member
Joined
Jan 14, 2025
Messages
2
Reaction score
0
Credits
24
Problem:
The speed of the router on Linux drops after transferring the router from hardware (PC) to VM (Hyper-V 2019), the same PC.

Question:
What can I set up on Hyper-V/Linux to bring the speed of the router on the VM closer to the speed of the router on the hardware?

The test computers from different VLANs and the router are connected via optics to a 10G switch (HP ProCurve 6120XG).
I tested the speed using iperf3 (parameters -P 8 -t 60) between the test computers.
Linux on hardware ~8 Gbit/sec
Linux on VM (Hyper-V 2019) ~4 Gbit/sec

Hardware router:
CPU: i7-4790, 4 cores, 8 threads
RAM: 32Gb
NIC1/NIC2: HP Ethernet 10Gb 2-port 560SFP+ Adapter, 10.50.0.1 (VLAN171), 10.50.1.1 (VLAN172)
OS: Oracle Linux 8.10

Hyper-V Router (2019):
vCPU: 8 cores
ram: 16Gb
ethernet1: 10.50.0.1 (VLAN171) -> vSwitch171 -> NIC1
ethernet2: 10.50.1.1 (VLAN172) -> vSwitch172 -> NIK2

I tried changing the vSwitch settings on Hyper-V:
  • Disable the RSC
  • Disable Large Send Offload (LSO)
The speed practically did not change.
 


I don't use that exact router, but we do use hyperV and a 20gig switch.

Some things that have worked for me.

disable C-States in the BIOS if you can.

Sometimes changing the clock source helps.

clocksource=tsc in your boot parameters.

Are you using VMQ? Are you using Jumboframes?

Finally, sometimes you make these changes.

/etc/sysctl.conf
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_wmem=4096 65536 16777216

sysctl -p
 
I don't use that exact router, but we do use hyperV and a 20gig switch.

Some things that have worked for me.

disable C-States in the BIOS if you can.

Sometimes changing the clock source helps.

clocksource=tsc in your boot parameters.

Are you using VMQ? Are you using Jumboframes?

Finally, sometimes you make these changes.

/etc/sysctl.conf
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_wmem=4096 65536 16777216

sysctl -p
VMQ is disabled, Jumboframes are not used
 

Members online


Top