Unraid Host, Ubuntu Guest VM Slow Network Performance

Howdy Everyone, I’m hoping someone might be able to point me in the correct direction. I’m running Unraid, and using VFIO to pass through my AMD 5600XT graphics card to and Ubuntu Guest. This works swell, except when it comes to networking. I also have a windows guest, and when I run on windows I’m able to saturate the network connection (as reported by speediest(DOT)net and fast(DOT)com) usually around 1.5 - 1.7 gbps. However when I run the ubuntu host the best I’m able to get is around 580 mbps. I can’t figure out exactly what is wrong and I’m hoping someone here might know. Both VMs have their Network Bridge set to br0 and the Network Model set to virtio-net. Below you will find the output of ip a from within the ubuntu guest

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.  1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 52:54:88:88:88:88 brd ff:ff:ff:ff:ff:ff
    inet 10.2.1. 4/16 brd 10.2.255.255 scope global dynamic noprefixroute enp3s0
       valid_lft 2047sec preferred_lft 2047sec
    inet6 fe80::7556:8050:a688:6d42/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

Thanks in advance!

The virtio network mount is terribly slow. Its not just an unraid thing, its a virtio thing. Consider using either an nfs or smb mount to regain full performance.

Thanks, but in this case my issue is with general network performance not network mounts I’m not using virtio network mount.

Ok… sorry. I should hold off reading questions until after my first cup of coffee.

So… your using an offsite speed test to test the network performance of your two unraid guest VMs. Do you have another machine on the local network where you could do performance testing to exclude the public speed test site? Its possible that the 3rd party site is treating the 2 guests differently somehow.

I would suggest using iperf3 to test on your local network.

A bit about my network, I’m running Untangle firewall. I have the Firewall and Unraid server connected over a 10Gbe DAC cable.

After fighting with untangle firewall to set up an perf server this is where I have landed.

I ran iperf directly on unraid and achieved the following results:

iperf3 -c 10.2.1.1 -t 5 
Connecting to host 10.2.1.1, port 5201
[  5] local 10.2.1.3 port 44944 connected to 10.2.1.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  1.07 GBytes  9.22 Gbits/sec    0    526 KBytes       
[  5]   1.00-2.00   sec  1.09 GBytes  9.37 Gbits/sec    0    370 KBytes       
[  5]   2.00-3.00   sec  1.09 GBytes  9.38 Gbits/sec    0    368 KBytes       
[  5]   3.00-4.00   sec  1.09 GBytes  9.35 Gbits/sec    0    416 KBytes       
[  5]   4.00-5.00   sec  1.09 GBytes  9.36 Gbits/sec    0    436 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec  5.43 GBytes  9.34 Gbits/sec    0             sender
[  5]   0.00-5.00   sec  5.43 GBytes  9.33 Gbits/sec                  receiver

I then rani perf from within the Ubuntu Guest:

Connecting to host 10.2.1.1, port 5201
[  5] local 10.2.1.4 port 57260 connected to 10.2.1.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.01   sec   109 MBytes   906 Mbits/sec    0    679 KBytes       
[  5]   1.01-2.00   sec   105 MBytes   887 Mbits/sec    0    792 KBytes       
[  5]   2.00-3.01   sec   111 MBytes   927 Mbits/sec    0   1.05 MBytes       
[  5]   3.01-4.00   sec   100 MBytes   847 Mbits/sec    0   1.13 MBytes       
[  5]   4.00-5.01   sec   105 MBytes   871 Mbits/sec    0   1.13 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.01   sec   530 MBytes   888 Mbits/sec    0             sender
[  5]   0.00-5.01   sec   530 MBytes   887 Mbits/sec                  receiver

As you can see bare metal out performs ubuntu quite handily. I will update with windows iperf results shortly

It looks as if the ubuntu guest is being held to around 1Gb connection speed.

Unfortunately my unraid server is currently still using a single 1Gb connection to my home LAN. As such I do not see a speed degradation in my guest VMs. They are able to saturate the host connection speed of 1Gb/s (~840Mbps after TCP overhead).

Hopefully one of the other more advanced users around here can chime in on why an ubuntu guest might behave different than a Windows guest in this configuration. If I had to guess, I would be willing to bet that not all the right options are set in the ubuntu kernel build to best support virtual interface connections. As I said, though, this is just a guess on my part.

Thanks for your help! I seem to have stumbled upon a solution. changing the Network model from virtio-net to virtio seems to fix the issue and I’m able to nearly saturate the connection inside of ubuntu.

1 Like

Interesting addendum…

So, using my unraid server as the iperf3 server and then running the speed test from the VM, my unraid machine is able to internally run the test at ~22 Gb/s.

Unraid Host:

root@legion:~# iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.2.62, port 52578
[  5] local 192.168.2.60 port 5201 connected to 192.168.2.62 port 52580
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  2.66 GBytes  22.8 Gbits/sec                  
[  5]   1.00-2.00   sec  2.59 GBytes  22.3 Gbits/sec                  
[  5]   2.00-3.00   sec  2.55 GBytes  21.9 Gbits/sec                  
[  5]   3.00-4.00   sec  2.49 GBytes  21.4 Gbits/sec                  
[  5]   4.00-5.00   sec  2.58 GBytes  22.2 Gbits/sec                  
[  5]   5.00-6.00   sec  2.68 GBytes  23.0 Gbits/sec                  
[  5]   6.00-7.00   sec  2.61 GBytes  22.4 Gbits/sec                  
[  5]   7.00-8.00   sec  2.66 GBytes  22.9 Gbits/sec                  
[  5]   8.00-9.00   sec  2.68 GBytes  23.0 Gbits/sec                  
[  5]   9.00-10.00  sec  2.67 GBytes  22.9 Gbits/sec                  
[  5]  10.00-10.04  sec   108 MBytes  23.2 Gbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.04  sec  26.3 GBytes  22.5 Gbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

Guest ubutnu 20.04 VM:

iperf3 -c 192.168.2.60
Connecting to host 192.168.2.60, port 5201
[  4] local 192.168.2.62 port 52580 connected to 192.168.2.60 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  2.76 GBytes  23.7 Gbits/sec    0   3.14 MBytes
[  4]   1.00-2.00   sec  2.57 GBytes  22.1 Gbits/sec    0   3.75 MBytes
[  4]   2.00-3.00   sec  2.57 GBytes  22.1 Gbits/sec    0   3.87 MBytes
[  4]   3.00-4.00   sec  2.50 GBytes  21.5 Gbits/sec    0   3.87 MBytes
[  4]   4.00-5.00   sec  2.58 GBytes  22.2 Gbits/sec    0   3.87 MBytes
[  4]   5.00-6.00   sec  2.68 GBytes  23.0 Gbits/sec    0   3.87 MBytes
[  4]   6.00-7.00   sec  2.61 GBytes  22.4 Gbits/sec    0   3.87 MBytes
[  4]   7.00-8.00   sec  2.67 GBytes  22.9 Gbits/sec    0   3.87 MBytes
[  4]   8.00-9.00   sec  2.68 GBytes  23.1 Gbits/sec    0   3.87 MBytes
[  4]   9.00-10.00  sec  2.67 GBytes  22.9 Gbits/sec    0   3.87 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec  26.3 GBytes  22.6 Gbits/sec    0             sender
[  4]   0.00-10.00  sec  26.3 GBytes  22.6 Gbits/sec                  receiver

Internally, it does not appear that unraid is bottlenecked. My setup is an X470 motherboard with a 2700X cpu. All in a stock/non overclocked configuration.

Great news!

Glad you were able to find a solution. I’ll have to catalog this away. I do intend on adding 10 Gbe card to my unraid in the near future.