Page 1 of 1

slow network with Ubuntu guest

Posted: 11. Mar 2017, 15:24
by jauling
I've been trying to troubleshoot and determine root cause for network performance issues with my Asustor NAS Virtualbox host for quite a few weeks now, and I can't seem to get anywhere. Asustor has confirmed they have reproduced my issue, but they've asked me to contact Virtualbox since they have no idea what the problem is.

In a nutshell, my Linux VM is exhibiting network performance issues in one direction. I've been testing throughput using iperf3 from multiple sources and have also patched directly (no router/switch) to my NAS to do the testing, but there's no changes in behavior. My linux guest can run iperf3 at close to line speeds as a client, but reverse the direction, and it piddles down to 200-300Mbps. All my other iperf3 sources are able to do ~940Mbps consistently between each other, including the ADM host OS. If I run iperf3 between the host and guest, I get over 1.5Gbps (seems slow).

I've tried fiddling with the network adapter type, as well as the paravirtualization interface, but nothing seems to help. Linux guest is fully updated via apt-get. Anyone have any thoughts?

Code: Select all

root@feeble:~# iperf3 -c loopy2 -t 5
Connecting to host loopy2, port 5201
[  4] local 10.4.2.22 port 40420 connected to 10.4.2.11 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec   110 MBytes   918 Mbits/sec    0    215 KBytes
[  4]   1.00-2.00   sec   108 MBytes   905 Mbits/sec    0    215 KBytes
[  4]   2.00-3.00   sec   106 MBytes   893 Mbits/sec    0    215 KBytes
[  4]   3.00-4.00   sec   106 MBytes   889 Mbits/sec    0    215 KBytes
[  4]   4.00-5.00   sec   109 MBytes   916 Mbits/sec    0    215 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-5.00   sec   539 MBytes   904 Mbits/sec    0             sender
[  4]   0.00-5.00   sec   538 MBytes   902 Mbits/sec                  receiver

iperf Done.
root@feeble:~# iperf3 -c loopy2 -t 5 -R
Connecting to host loopy2, port 5201
Reverse mode, remote host loopy2 is sending
[  4] local 10.4.2.22 port 40424 connected to 10.4.2.11 port 5201
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec  42.7 MBytes   358 Mbits/sec
[  4]   1.00-2.00   sec  40.8 MBytes   343 Mbits/sec
[  4]   2.00-3.00   sec  41.6 MBytes   349 Mbits/sec
[  4]   3.00-4.00   sec  41.2 MBytes   345 Mbits/sec
[  4]   4.00-5.00   sec  42.4 MBytes   356 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-5.00   sec   209 MBytes   350 Mbits/sec                  sender
[  4]   0.00-5.00   sec   209 MBytes   350 Mbits/sec                  receiver

iperf Done.
FWIW, before this morning, I was running Virtualbox 4.3.36. Found out Asustor had a NAS OS upgrade and Virtualbox upgrade, so I gave 5.1.14 a shot. Same network performance issue on Virtualbox 4.3.36 as well.

Linux Host:
*Asustor AS5104T: J1900 quadcore Celeron w/8GB RAM
*Asustor ADM2.7.0RF72 OS w/Linux 4.4.24 #1 SMP Tue Mar 7 03:17:37 CST 2017 x86_64
*Virtualbox 5.1.14

Linux Guest (only one):
*Ubuntu 16.04.2 LTS w/Linux 4.4.0-66-generic #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017 x86_64
*2vCPU + 2GB RAM
*Virtualbox Guest Additions 5.0.32
VBox.log
Linux VM VBox Log
(64.88 KiB) Downloaded 8 times
Some virt info from the guest:

Code: Select all

root@feeble:~# dmesg | grep -i virt
[    0.000000] DMI: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
[    0.000000] CPU MTRRs all blank - virtualized system.
[    0.000000] Booting paravirtualized kernel on KVM
[    0.549126] KVM setup paravirtual spinlock
[    1.915396] virtio-pci 0000:00:03.0: virtio_pci: leaving for legacy driver
[    2.276507] virtio_net virtio0 enp0s3: renamed from eth0
[    9.676482] systemd[1]: Detected virtualization oracle.

root@feeble:~# dpkg -l | grep virtualbox
ii  virtualbox-guest-dkms                5.0.32-dfsg-0ubuntu1.16.04.2      all          x86 virtualization solution - guest addition module source for dkms
ii  virtualbox-guest-utils               5.0.32-dfsg-0ubuntu1.16.04.2      amd64        x86 virtualization solution - non-X11 guest utilities
ii  virtualbox-guest-x11                 5.0.32-dfsg-0ubuntu1.16.04.2      amd64        x86 virtualization solution - X11 guest utilities

Re: slow network with Ubuntu guest

Posted: 3. May 2017, 10:28
by jauling
One thing I have not tried since upgrading Virtualbox from 4.3.36 to 5.1.14 is I did not go through all the network adapter types. I had the wild idea that the virtio_net driver in Linux would be the superior choice, so it wouldn't make much sense to try Intel drivers. Boy, was I wrong!

I changed the network adaptor from virtio to 82545EM, and I'm getting pretty close to line speed in both directions. My guess is the J1900 CPU might be my limiting factor.

Apologies for the false alarm, looks like the newer Virtualbox 5.1.x did the trick! Stay away from the virtio network driver!

Code: Select all

root@feeble:~# iperf3 -c loopy2 -t 5
Connecting to host loopy2, port 5201
[  4] local 10.4.2.22 port 58088 connected to 10.4.2.11 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec   109 MBytes   909 Mbits/sec    0    219 KBytes
[  4]   1.00-2.01   sec   109 MBytes   913 Mbits/sec    0    219 KBytes
[  4]   2.01-3.00   sec   109 MBytes   915 Mbits/sec    0    219 KBytes
[  4]   3.00-4.00   sec   112 MBytes   940 Mbits/sec    0    219 KBytes
[  4]   4.00-5.00   sec   111 MBytes   927 Mbits/sec    0    219 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-5.00   sec   549 MBytes   921 Mbits/sec    0             sender
[  4]   0.00-5.00   sec   548 MBytes   919 Mbits/sec                  receiver

iperf Done.
root@feeble:~# iperf3 -c loopy2 -t 5 -R
Connecting to host loopy2, port 5201
Reverse mode, remote host loopy2 is sending
[  4] local 10.4.2.22 port 58092 connected to 10.4.2.11 port 5201
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec   103 MBytes   862 Mbits/sec
[  4]   1.00-2.00   sec   103 MBytes   865 Mbits/sec
[  4]   2.00-3.00   sec   103 MBytes   864 Mbits/sec
[  4]   3.00-4.00   sec   103 MBytes   862 Mbits/sec
[  4]   4.00-5.00   sec  96.1 MBytes   806 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-5.00   sec   508 MBytes   852 Mbits/sec                  sender
[  4]   0.00-5.00   sec   508 MBytes   852 Mbits/sec                  receiver

iperf Done.