joostman
Posts: 4
Joined: Wed Jul 04, 2018 6:07 pm

Raspberry pi does not get normal internet speeds

Sat Jul 14, 2018 10:27 pm

My question:
I have a Raspberry Pi 3B+ with build in gigabit adapter. If I connect this with a CAT6a cable to my Unifi switch, I will get around 50-60 Mbps (Megabits per second) while expecting 200Mbps (provided by provider) thru a “speedtest-cli”. Doing this command line test on my (Synology DS1813+) NAS or Laptop (webbrowser / CLI) I do get these results, all on the same switch.

Relevant software and hardware I use:
- Raspberry Pi 3B+ with build in gigabit adapter. (Raspberry Pi 3 Model B Plus Rev 1.3)
- Cat 6a cables (tried others as well)
- Ubiquiti equipment (switch, router and AP) (UniFi Switch 16 POE-150W - UniFi Security Gateway 3P, UniFi AP-AC-Pro)
- Ziggo Connectbox (Internet provider)
- Synology NAS from 2013
- Command: “sudo speedtest-cli --server 3587” (every time the same server)
- Tried wget as well for speedtest (100mb bin file) this also transfers
- Network setup: Connectbox --> Router --> Switch --> Pi / NAS / Laptop / other switch and equipment.
- All equipment have a static IP, the Pi via “/etc/network/interfaces”
- Default GW tried from provider Ziggo, Ubiquiti switch and Google in /etc/resolve.conf.
- latest version: Linux p1mon 4.14.52-v7+ #1123 SMP Wed Jun 27 17:35:49 BST 2018 armv7l GNU/Linuxx
- Only 1 USB connector is being used for monitoring my power / gas consumption.
- The CPU usage on the Pi is never above 20% average
- Different MTU values, see below.
- Iperf3 to test LAN speeds, which work fine, see below. (Although the Pi has a GB adapter, the speed is limited due to USB2 connection and will never go above )

What I already tried:
Pi connected to Ubiquiti switch
- Command "sudo speedtest-cli --server 3587" on NAS and PI and www.speedtest.net on laptop.
Result: Laptop and NAS give around 180 to 200 Mbps, Pi around 50 to 60 Mbps.

- Command "sudo ethtool -s eth0 speed 100 duplex full"
A strange behaviour, as with this command I put force the network speed to 100Mbps BUT during tests afterwards I get around 80 to 90 Mbps...
Putting the value back to 1000Mbps I drop back to 50 to 60 Mbps. (See below output)

Pi connected directly to Ziggo connectbox
- Commando "sudo speedtest-cli --server 3587" PI en www.speedtest.net on laptop.
Result: Laptop around 180 and 200 Mbps, around 180 and 190 Mbps. (This is what I want!)
I cannot leave the Pi connected like this, as the Pi is running the management software of my Ubiquiti hardware and the provider network is running in a different network (ip) range. (The private range from Ziggo is another private range than my Ubiquiti private network)

- On the Ubiquiti switch I disabled DPI / IDS / IDP

========

Code: Select all

[email protected]:~/Download$ sudo ethtool -s eth0 speed 1000 duplex full
[email protected]:~/Download$ sudo speedtest-cli --server 3587 --secure --no-upload
Retrieving speedtest.net configuration...
Testing from Ziggo (xx.xx.xx.xx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by LeaseWeb (Haarlem) [24.07 km]: 32.4 ms
Testing download speed................................................................................
Download: 51.01 Mbit/s
======

Code: Select all

[email protected]:~/Download$ sudo ethtool -s eth0 speed 100 duplex full
[email protected]:~/Download$ sudo speedtest-cli --server 3587 --secure --no-upload
Retrieving speedtest.net configuration...
Testing from Ziggo (xx.xx.xx.xx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by LeaseWeb (Haarlem) [24.07 km]: 32.65 ms
Testing download speed................................................................................
Download: 84.26 Mbit/s
=========

Code: Select all

[email protected]:~$ sudo ifconfig eth0 mtu 1500
[email protected]:~$ sudo speedtest-cli --server 3587 --secure --no-upload
Retrieving speedtest.net configuration...
Testing from Ziggo (xx.xx.xx.xx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by LeaseWeb (Haarlem) [24.07 km]: 29.007 ms
Testing download speed................................................................................
Download: 52.04 Mbit/s
Skipping upload test
[email protected]:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=11.5 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=12.2 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=57 time=12.5 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=57 time=11.5 ms
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 11.517/11.969/12.567/0.468 ms
[email protected]:~$ sudo ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.178.144  netmask 255.255.255.0  broadcast 192.168.178.255
        inet6 fe80::ba27:ebff:fee3:63e2  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:e3:63:e2  txqueuelen 1000  (Ethernet)
        RX packets 987788  bytes 1290018955 (1.2 GiB)
        RX errors 0  dropped 5  overruns 0  frame 0
        TX packets 572144  bytes 40060185 (38.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Other values I tried:
- 750 = 36 Mbit
- 1000 = 40 Mbit
- 1200 = 48 Mbit
- 1300 = 49 Mbit
- 1400 = 48 Mbit
- 1492 = 48 Mbit
- 1500 = 52 Mbit
- 2000 = 51 Mbit
- 9000 = 52 Mbit

======

Code: Select all

[email protected]:~$ iperf3 -c 192.168.178.140
Connecting to host 192.168.178.140, port 5201
[  4] local 192.168.178.144 port 60688 connected to 192.168.178.140 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  38.1 MBytes   320 Mbits/sec    0    277 KBytes       
[  4]   1.00-2.00   sec  37.2 MBytes   312 Mbits/sec    0    277 KBytes       
[  4]   2.00-3.00   sec  37.2 MBytes   312 Mbits/sec    0    277 KBytes       
[  4]   3.00-4.00   sec  37.2 MBytes   312 Mbits/sec    0    277 KBytes       
[  4]   4.00-5.00   sec  37.4 MBytes   314 Mbits/sec    0    277 KBytes       
[  4]   5.00-6.00   sec  37.2 MBytes   312 Mbits/sec    0    277 KBytes       
[  4]   6.00-7.00   sec  37.6 MBytes   315 Mbits/sec    0    277 KBytes       
[  4]   7.00-8.00   sec  37.3 MBytes   313 Mbits/sec    0    277 KBytes       
[  4]   8.00-9.00   sec  37.3 MBytes   313 Mbits/sec    0    277 KBytes       
[  4]   9.00-10.00  sec  39.2 MBytes   329 Mbits/sec    0    414 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   376 MBytes   315 Mbits/sec    0             sender
[  4]   0.00-10.00  sec   374 MBytes   314 Mbits/sec                  receiver

iperf Done.
[email protected]:~$ iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.178.140, port 59685
[  5] local 192.168.178.144 port 5201 connected to 192.168.178.140 port 59686
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-1.00   sec  24.6 MBytes   206 Mbits/sec                  
[  5]   1.00-2.00   sec  25.7 MBytes   216 Mbits/sec                  
[  5]   2.00-3.00   sec  25.5 MBytes   214 Mbits/sec                  
[  5]   3.00-4.00   sec  26.0 MBytes   218 Mbits/sec                  
[  5]   4.00-5.00   sec  25.4 MBytes   213 Mbits/sec                  
[  5]   5.00-6.00   sec  25.5 MBytes   214 Mbits/sec                  
[  5]   6.00-7.00   sec  25.7 MBytes   216 Mbits/sec                  
[  5]   7.00-8.00   sec  25.9 MBytes   218 Mbits/sec                  
[  5]   8.00-9.00   sec  25.5 MBytes   214 Mbits/sec                  
[  5]   9.00-10.00  sec  25.3 MBytes   212 Mbits/sec                  
[  5]  10.00-10.03  sec   829 KBytes   220 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-10.03  sec  0.00 Bytes  0.00 bits/sec                  sender
[  5]   0.00-10.03  sec   256 MBytes   214 Mbits/sec                  receiver
iperf3: the client has unexpectedly closed the connection

SuperBoby
Posts: 11
Joined: Sat Jul 14, 2018 5:05 pm
Location: France

Re: Raspberry pi does not get normal internet speeds

Sat Jul 14, 2018 10:46 pm

The Ethernet adapter of the Pi being connected through the USB bus, thus sharing bandwith with the USB devices, did you try it without any USB plugged in ? (SSH, serial console...)


Return to “Troubleshooting”