DiePi Slow Network Speed on XU4

Hey,
im running the newest stable version of dietPi on my Odroid Xu4.
My Windows pc and the odroid are connected with 1Gbit Lan.
Connecting to the odroid with SFTP, my upload speed from windows → odroid is only 10-12m/s and download is also 10-12mb/s.

Any adwise how to find the problem ?

Cheers
Lars

Do you connect directly to the local IP or do you use some sort of DDNS and maybe it’s getting routed through the internet?

Direct connect over ip.

Also tested the hardware:

root@DietPi:~# hdparm -T /dev/mmcblk0p1

/dev/mmcblk0p1:
Timing cached reads: 1520 MB in 2.00 seconds = 760.46 MB/sec
root@DietPi:~# hdparm -T /dev/sda1

/dev/sda1:
Timing cached reads: 1606 MB in 2.00 seconds = 803.81 MB/sec
root@DietPi:~# ^C
root@DietPi:~# sync; dd if=/dev/sda1 of=tempfile bs=1M count=1024; sync
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 20.7815 s, 51.7 MB/s
root@DietPi:~# sync; dd if=/dev/mmcblk0p1 of=tempfile bs=1M count=1024; sync
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 30.3535 s, 35.4 MB/s

traceroute Linux → Windows

traceroute to 192.168.178.20 (192.168.178.20), 30 hops max, 60 byte packets
 1  DESKTOP-MyPc.fritz.box (192.168.178.20)  1.233 ms  0.721 ms  1.054 ms

traceroute windows → Linux

Routenverfolgung zu DietPi.fritz.box [192.168.178.69]
über maximal 30 Hops:

  1     1 ms    <1 ms     1 ms  DietPi.fritz.box [192.168.178.69]

Iperf3 Test

Accepted connection from 192.168.178.20, port 61718
[  5] local 192.168.178.69 port 5201 connected to 192.168.178.20 port 61719
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  10.5 MBytes  88.3 Mbits/sec
[  5]   1.00-2.00   sec  11.2 MBytes  94.2 Mbits/sec
[  5]   2.00-3.00   sec  11.3 MBytes  94.4 Mbits/sec
[  5]   3.00-4.00   sec  11.2 MBytes  94.1 Mbits/sec
[  5]   4.00-5.00   sec  10.8 MBytes  90.6 Mbits/sec
[  5]   5.00-6.00   sec  10.8 MBytes  90.8 Mbits/sec
[  5]   6.00-7.02   sec  9.40 MBytes  77.7 Mbits/sec
[  5]   7.02-8.00   sec  10.1 MBytes  86.3 Mbits/sec
[  5]   8.00-9.00   sec  9.87 MBytes  82.8 Mbits/sec
[  5]   9.00-10.00  sec  11.3 MBytes  95.0 Mbits/sec
[  5]  10.00-10.06  sec   674 KBytes  94.1 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.06  sec   107 MBytes  89.4 Mbits/sec                  receiver

settings of eth0

Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  Not reported
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00007fff (32767)
                               drv probe link timer ifdown ifup rx_err tx_err tx_queued intr tx_done rx_status pktdata hw wol
        Link detected: yes

Smth with network must be wrong

Okay i can answer this by myself. The LAN cable of my Windows → switch was broken, i only changed the one from XU4 → switch. Now on my windows pc the led is orange and green, on the broken cable it was orange and smth like red.

So it was only running at 100Mbit instead of 1000 :+1:

Another point to consider:
The IRQ for xhci-hcd:usb5 to which the LAN-device is connected is assigned to CPU core 0 - which is a slow little-core. (see: cat /proc/interrupts)

You will gain significant performance boost by assigning it to one of the BIG-cores (4-7).
For me this made a difference about 150Mbit/s for transfers from PC to XU4/HC1/HC2/MC1 and about 100Mbit/s vice versa.

Before:

$ iperf -c odroidxu4 -i5 -t30
------------------------------------------------------------
Client connecting to odroidxu4, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  1] local 192.168.###.201 port 43546 connected with 192.168.###.203 port 5001 (icwnd/mss/irtt=14/1448/915)
[ ID] Interval       Transfer     Bandwidth
[  1] 0.0000-5.0000 sec   423 MBytes   709 Mbits/sec
[  1] 5.0000-10.0000 sec   456 MBytes   765 Mbits/sec
[  1] 10.0000-15.0000 sec   472 MBytes   791 Mbits/sec
[  1] 15.0000-20.0000 sec   458 MBytes   768 Mbits/sec
[  1] 20.0000-25.0000 sec   468 MBytes   786 Mbits/sec
[  1] 25.0000-30.0000 sec   465 MBytes   780 Mbits/sec
[  1] 0.0000-30.0438 sec  2.68 GBytes   766 Mbits/sec

After:

$ iperf -c odroidxu4 -i5 -t30
------------------------------------------------------------
Client connecting to odroidxu4, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  1] local 192.168.###.201 port 58502 connected with 192.168.###.203 port 5001 (icwnd/mss/irtt=14/1448/863)
[ ID] Interval       Transfer     Bandwidth
[  1] 0.0000-5.0000 sec   552 MBytes   926 Mbits/sec
[  1] 5.0000-10.0000 sec   557 MBytes   935 Mbits/sec
[  1] 10.0000-15.0000 sec   557 MBytes   934 Mbits/sec
[  1] 15.0000-20.0000 sec   557 MBytes   935 Mbits/sec
[  1] 20.0000-25.0000 sec   558 MBytes   935 Mbits/sec
[  1] 25.0000-30.0000 sec   557 MBytes   934 Mbits/sec
[  1] 0.0000-30.0347 sec  3.26 GBytes   932 Mbits/sec