Slow download speed via ethernet cable on raspberry 3 b+


#1

Hello,

I have installed osmc on a new raspberry 3b+
Because I’ve found that streaming online content was slow and/or buffering. I decided to test the internet speed.
I don’t know how to use iperf, so I used ARNU Box Speed Tester.
The dowload speed via ethernet cable is between 15 an 30 mbits/s which is very slow, the upload speed is around 30 mbits/s which is normal.
When I unplug the ethernet cable from the raspberry en plug this cable in my laptop and run speedtest, I get a speed of 250mbits/s down en 30-40 mbits/s up
If I enable the wireless connection (wifi) on my raspberry (and disable the wired connection) I Get e download speed with een average of 60 mbits down and 30 mbits up.

I have tried to Google and I have searched this forum, but could not find a possible solution.
Does anyone know how to find the cause of this problem and how to solve it?
Is this a hardware or a software problem?


#2

Hi,

May find it more stable if you reduce the speed to 10/100 rather than gigabit:

sudo apt-get update
sudo apt-get install ethtool
sudo ethtool -s eth0 speed 100 duplex full autoneg on

Then test the speed again.

Thanks Tom.


#3

Thanks Tom,
I managed to use iperf3… I have connected laptop and raspberry with an ethernet cable and got very different (normal) results. With sudo iperf3 -c (SERVER IP> on the raspberry I got an average bandwith of 313mbits. I guess this means that the ethernet speed is fine.
I was still wondering why the speedtest program showed a wired network speed which is half the speed of the wifi connection. Normally I would think that the program is buggy, So I installed speedtest-cli for use with the ssh command and got the same results. I’ve got an average download speed of 35-40 mbits. and with wifi an average of 60 mbits.
Then I used the ethtool to change the speed to 100 full duplex, Now the iperf3 command shows a bandwith of 95 mbits and speedtest-cli shows a download speed of 87 mbits.
So reducing the eth0 speed does change the internet download speed.
I don’t know what download speeds i should expect on a raspberry 3 b+ ?
Are there other possibilities to speed-up internet?


#4

Hi,

I would say 87 Mbits would be more than sufficient and setting the speed to 100 is going to be more stable. I would try streaming some content, and see if there is any improvement.

Thanks Tom.


#5

I tried to stream content and there’s a bit of improvement.
But after a restart or after changing the internet connection, the settings are lost.
How do I store the ethtool settings?


#6

Hi,

Wanted to make sure that reducing to the speed to 100, would help; before getting into how to make it persistent after rebooting.

Thanks Tom.


#7

An RPi3 is not capable of high speeds, because it’s SOC can’t handle it. Also, ethernet in the RPI is on the same bus as USB, so if you download to USB drive, the bandwidth is shared. Ibelieve it maxes out around total of 7MB/s.


#8

Reducing the speed to 100 is making the download speed stable at 85-95 mbits which is acceptable given the 100 mbit setting.
Thanks for the read about the RX flow control of the driver, which I think points out the problem.
I’ll do some more testing tonight when I’m back home to find out if that’s the case.


#9

As far as I knew before buying the Raspberry 3 B+, You don’t get Gigabit speed, but a theoretical maximum of 300 mbits/s because the ethernet controller uses the USB channel. The iperf test also show a bandwith of 313 mbits/s as a result.
I expected that my download speed would be close to this. (like 250mbits/s or 31 MB/s)
I don’t download to an USB stick, but I have an USB stick connected to the raspberry. Is it possible that this makes a difference? (I will also test this tonight)


#10

I tested the speeds over and over again, giving the same results. Changing the speed to 100mbits is the best workaround so far. By the way, unplugging all the USB devices doesn’t make a difference. I don’t know how to test on package loss or how to find out if it’s really an issue of the RX flow control…
But if I get instructions how to make the 100mbits setting persistent it would be a great help for now. I can always change the settings back to normal when another solution comes available.


#11

Hi,

To test whether flow control is causing the issue, with out adjusting the speed try this:

sudo ethtool -A eth0 RX off

Then run iperf & test speeds again. I suspect you will get better results with just setting the speed to 100.

adding:

/sbin/ethtool -s eth0 speed 100 duplex full autoneg on

to /etc/rc.local should do it. The link I posted also mentions tweaking when when rc.local is run, but this should be required.

if you have any issues with rc.local I would check the following:

systemctl status rc.local

Thanks Tom.


#12

OK. I share some details of my tests with iperf3 and speedtest-cli.
I tested gigabit and 100mbit settings with both rx flow control on and off.

1st test at normal/standard settings:

osmc@osmc:~$ sudo ethtool -a eth0
Pause parameters for eth0:
Autonegotiate:  on
RX:             on
TX:             on
RX negotiated:  on
TX negotiated:  on

osmc@osmc:~$ iperf3 -c 192.168.1.19
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   375 MBytes   315 Mbits/sec    0             sender
[  4]   0.00-10.00  sec   374 MBytes   314 Mbits/sec                  receiver

osmc@osmc:~$ speedtest-cli
Download: 52.47 Mbit/s
Upload: 39.31 Mbit/s

P.S. I used “sudo ethtool -A eth0 rx off”, “sudo ethtool -A eth0 RX off” (with capitals) was not working

2nd test, testing flow control with rx setting off:

osmc@osmc:~$ sudo ethtool -A eth0 rx off

osmc@osmc:~$ sudo ethtool -a eth0
Pause parameters for eth0:
Autonegotiate:  on
RX:             off
TX:             on
RX negotiated:  off
TX negotiated:  on

osmc@osmc:~$ sudo iperf3 -c 192.168.1.19
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   371 MBytes   311 Mbits/sec    0             sender
[  4]   0.00-10.00  sec   370 MBytes   311 Mbits/sec                  receiver

osmc@osmc:~$ speedtest-cli
Download: 44.72 Mbit/s
Upload: 38.89 Mbit/s

Not much of a difference. The download speed is a bit, but not notably lower.

Test 3: Now i changed the network speed to 100 mbits (RX flowcontrol on)

osmc@osmc:~$ sudo ethtool -A eth0 rx on
osmc@osmc:~$ sudo ethtool -a eth0
Pause parameters for eth0:
Autonegotiate:  on
RX:             on
TX:             on
RX negotiated:  on
TX negotiated:  on

osmc@osmc:~$ sudo ethtool -s eth0 speed 100 duplex full autoneg on

osmc@osmc:~$ sudo iperf3 -c 192.168.1.19
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   113 MBytes  94.8 Mbits/sec    0             sender
[  4]   0.00-10.00  sec   113 MBytes  94.5 Mbits/sec                  receiver

osmc@osmc:~$ speedtest-cli
Download: 87.78 Mbit/s
Upload: 38.95 Mbit/s

iperf3 shows a lower bandwith close to the 100mbit setting which is expected.
speedtest-cli shows a download speed which is much higher and is as expected given the 100mbit setting.

Test 4: at 100mbits, now with RX setting off again

osmc@osmc:~$ sudo ethtool -A eth0 rx off
osmc@osmc:~$ sudo ethtool -a eth0
Pause parameters for eth0:
Autonegotiate:  on
RX:             off
TX:             on
RX negotiated:  off
TX negotiated:  on

osmc@osmc:~$ sudo iperf3 -c 192.168.1.19
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   114 MBytes  95.4 Mbits/sec    0             sender
[  4]   0.00-10.00  sec   113 MBytes  95.0 Mbits/sec                  receiver

osmc@osmc:~$ speedtest-cli
Download: 91.96 Mbit/s
Upload: 39.07 Mbit/s

The rx setting doesn’t give much different results. Setting eth0 to 100mbits/s does.

I hope this clears things up?


#13

For better testing I’d suggest just staying with iperf3 as it is only testing your local network. There are too many variables involved for the results from speedtest-cli to be of any real use.

Run a longer test with iperf3, like a 5 minute test.

iperf3 -t300 -c192.168.1.19 -i1

You will see a report every second, watch for empty intervals.


#14

Hi,

seems pretty clear to that setting the speed to 100 is the way forward for now, until the issue gigabit Ethernet is resolved. The issue is not only affecting osmc, its still on going for raspbian as well.

Tom.


#15

I’m still learning new things on how to use different commands.
I ran a 5 minute iperf3 test with the standard/normal settings.
The results are quite stable, with a bandwidth at 313mbits/s and no empty intervals
I run the same test again on 100mbits with rx off and get stable results at 95,1 mbits (no empty intervals)
Repeated tests of speedtest-cli differ a small bit, so I don’t pay a lot of attention to readings which changes less than 10 mbits/s. But the speed-change of downloading with the 100mbit setting is very noticeable and the upload speed is very constant.


#16

@Tom_Doyle, Thanks a lot for your help. I’ve added the settings to /etc/rc.local and I’m satisfied with the workaround. I hope the gigabit Ethernet issue is getting resolved.


#17

Did you tried reverse mode -R?


#18

Oké I tried the reverse mode and I got different results with iperf3
speedtest-cli results remained the same.

I used the following command:
iperf3 -t60 -c192.168.1.19 -i1 -R

Iperf3 results with speed reduced to 100 mbit (rx on/off didn’t make a difference)

[  4]  23.00-24.00  sec  5.47 MBytes  45.9 Mbits/sec
[  4]  24.00-25.00  sec  4.67 MBytes  39.2 Mbits/sec
[  4]  25.00-26.00  sec  4.02 MBytes  33.7 Mbits/sec
[  4]  26.00-27.00  sec  4.39 MBytes  36.8 Mbits/sec
[  4]  27.00-28.00  sec  4.59 MBytes  38.5 Mbits/sec
[  4]  28.00-29.00  sec  7.44 MBytes  62.4 Mbits/sec
[  4]  29.00-30.00  sec  7.69 MBytes  64.5 Mbits/sec
[  4]  30.00-31.00  sec  7.77 MBytes  65.2 Mbits/sec
[  4]  31.00-32.00  sec  11.0 MBytes  92.6 Mbits/sec
[  4]  32.00-33.00  sec  7.60 MBytes  63.8 Mbits/sec

speedtest-cli results (100 mbit setting):

Download: 92.57 Mbit/s
Upload: 39.64 Mbit/s

Then i restored the speed to gigabit again and got the following results:

[  4]  30.00-31.00  sec  17.9 MBytes   150 Mbits/sec
[  4]  31.00-32.00  sec  26.4 MBytes   222 Mbits/sec
[  4]  32.00-33.00  sec  9.36 MBytes  78.5 Mbits/sec
[  4]  33.00-34.00  sec  26.4 MBytes   222 Mbits/sec
[  4]  34.00-35.00  sec  26.3 MBytes   220 Mbits/sec
[  4]  35.00-36.00  sec  26.2 MBytes   220 Mbits/sec
[  4]  36.00-37.00  sec  17.5 MBytes   147 Mbits/sec
[  4]  37.00-38.00  sec  24.4 MBytes   205 Mbits/sec

speedtest-cli (gigabit setting):

Download: 51.68 Mbit/s
Upload: 39.48 Mbit/s

It looks like the iperf3 reverse setting shows measurements which are a bit lower
+/- 311mbits to 220 mbits or +/- 91mbits to 64 mbits
The speeds are also less stable with the reverse mode compared to earlier measurements.
What does this mean and add to the conclusion?


#19

Well generally I suggest the -R switch as it reflects the usage of OSMC as a media center better.
But your fluctuations even on 100 Mbit are strange. You might want to check cables and router ports.