RPIgoodSBC
Posts: 60
Joined: Tue Mar 20, 2018 11:37 am

Re: RPi 3B+ gigabit ethernet bad download speeds.

Thu Jul 19, 2018 4:59 pm

More screenshots...
2018-07-19-dsl-reports-test-quality.png
2018-07-19-dsl-reports-test-quality.png (199.49 KiB) Viewed 3209 times
2018-07-19-RPI3B-plus-overclocked-ram-550-and-gpu-450.png
2018-07-19-RPI3B-plus-overclocked-ram-550-and-gpu-450.png (229.63 KiB) Viewed 3209 times

tfontaine
Posts: 12
Joined: Thu Feb 26, 2015 5:03 am
Location: Winnipeg, MB Canada
Contact: Website

Re: RPi 3B+ gigabit ethernet bad download speeds.

Fri Aug 03, 2018 5:00 am

joostman wrote:
Sun Jul 15, 2018 5:05 pm
magore wrote:
Sat Jul 07, 2018 2:46 am
I found the following settings help transfer speeds for the Ethernet port
Run as root

Code: Select all

sysctl -w net.core.rmem_max=8388608
sysctl -w net.core.wmem_max=8388608
sysctl -w net.core.rmem_default=65536
sysctl -w net.core.wmem_default=65536
sysctl -w net.ipv4.tcp_rmem='4096 87380 8388608'
sysctl -w net.ipv4.tcp_wmem='4096 65536 8388608'
sysctl -w net.ipv4.tcp_mem='8388608 8388608 8388608'
sysctl -w net.ipv4.route.flush=1
If I change this value, it looks like it worked, but checking afterwards, does not seem to have changed it.

Code: Select all

[email protected]:/$ sudo sysctl -w net.core.wmem_default=65536
net.core.wmem_default = 65536
[email protected]:/$ sudo sysctl -a | grep core.rmem
net.core.rmem_default = 163840
I was very enthusiastic and hoping this would fix it, but forgot to check what the default values were... :(
The speedtest did not change anything for me.

I also have 200 Mbit down / 20 up, but never get these figures from the download.
Only if I connect the Pi to my Ziggo (provider) router direct, it give me figures around the 200.
Now I have behind my provider router a Ubiquiti router and switch and the speeds are 1/4th of normal.
This is only the case for my Pi, a NAS, also on the same switch, does get the normal Internet speeds :-/

Code: Select all

[email protected]:~# 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) [26.84 km]: 904.579 ms
Testing download speed................................................................................
Download: 57.82 Mbit/s
Skipping upload test
[email protected]:~# 
I'm rocking a USG 3 and US-8-60W-to enable Flow Control, you have to go to the Unifi Controller, Devices, then click on the switch and at the right-side navigation, you have to go to the Config tab, Services and check "Enable flow control". Queue Changes, then apply the changes. Voila! Flow control enabled. This helped immensely with my home network and the Pi 3B+.
Pi 2 Model B
# 1: PiHole
# 2: ISO Hosting in Homelab (PXE Boot testing)
# 3: Jobless
Pi 3 Model B
# 1: 64-bit Linux Test
# 2: Jobless
Pi 3 Model B+
# 1: PiVPN
# 2: RetroPie

Eichhorn18
Posts: 51
Joined: Wed Jan 17, 2018 9:52 am

Re: RPi 3B+ gigabit ethernet bad download speeds.

Wed Aug 29, 2018 9:06 am

jamesh wrote:
Tue Jun 05, 2018 10:05 am
There is a suspected issue with Samba (and perhaps other network sharing mechanisms) that we haven't got to the bottom of yet, that may be unrelated.

The speedtest-cli result look exactly like flow control is not working effectively.
Is there any known issues with cifs as an alternative to samba?

Just for another data point, I have 800 Mbit/s service and i've connected a laptop with gigabit ethernet and gotten that delivery speed. The Raspberry Pi 3B+ on the same physical wire gives between 120 - 165 Mbit/s download, and upload between 100 - 220 Mbit/s.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6642
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RPi 3B+ gigabit ethernet bad download speeds.

Wed Aug 29, 2018 10:50 am

Eichhorn18 wrote:
Wed Aug 29, 2018 9:06 am
jamesh wrote:
Tue Jun 05, 2018 10:05 am
There is a suspected issue with Samba (and perhaps other network sharing mechanisms) that we haven't got to the bottom of yet, that may be unrelated.

The speedtest-cli result look exactly like flow control is not working effectively.
Is there any known issues with cifs as an alternative to samba?

Just for another data point, I have 800 Mbit/s service and i've connected a laptop with gigabit ethernet and gotten that delivery speed. The Raspberry Pi 3B+ on the same physical wire gives between 120 - 165 Mbit/s download, and upload between 100 - 220 Mbit/s.
CIFS is a dialect of the SMB protocol that Samba implements.
We're fairly certain that has been resolved now anyway. It was stalling a single TCP connection rather than a speed issue.
https://github.com/raspberrypi/linux/issues/2449
https://github.com/raspberrypi/linux/issues/2482

Yours sounds like the standard type of flow control issue. You have a bottle-neck in the USB2 interface from the ethernet adapter to the Pi of a theoretical max of 480Mbit/s, but more realisitcally around 250Mbit/s. The adapter will be sending ethernet flow control pause frames when it backs up, but those only work over the local network. There is no mechanism to make an internet server back off other than rely on TCP's standard backoff/retry mechanisms.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Eichhorn18
Posts: 51
Joined: Wed Jan 17, 2018 9:52 am

Re: RPi 3B+ gigabit ethernet bad download speeds.

Wed Aug 29, 2018 12:35 pm

6by9 wrote:
Wed Aug 29, 2018 10:50 am
CIFS is a dialect of the SMB protocol that Samba implements.
We're fairly certain that has been resolved now anyway. It was stalling a single TCP connection rather than a speed issue.
https://github.com/raspberrypi/linux/issues/2449
https://github.com/raspberrypi/linux/issues/2482

Yours sounds like the standard type of flow control issue. You have a bottle-neck in the USB2 interface from the ethernet adapter to the Pi of a theoretical max of 480Mbit/s, but more realisitcally around 250Mbit/s. The adapter will be sending ethernet flow control pause frames when it backs up, but those only work over the local network. There is no mechanism to make an internet server back off other than rely on TCP's standard backoff/retry mechanisms.
So I'm trying to transfer files through my local network, and scp from my windows machine is showing a max transfer speed of 11.5 MB/s.

What is required to check if flow control is turned on/off? I'm running an enterprise network through switches and some managed hubs.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6642
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RPi 3B+ gigabit ethernet bad download speeds.

Wed Aug 29, 2018 1:04 pm

Eichhorn18 wrote:
Wed Aug 29, 2018 12:35 pm
So I'm trying to transfer files through my local network, and scp from my windows machine is showing a max transfer speed of 11.5 MB/s.

What is required to check if flow control is turned on/off? I'm running an enterprise network through switches and some managed hubs.

Code: Select all

[email protected]:~ $ sudo ethtool -a eth0
Pause parameters for eth0:
Autonegotiate:	on
RX:		on
TX:		on
RX negotiated:	on
TX negotiated:	on
on = good. off = bad.
Most managed switches will have options to enable/disable flow control. Unmanaged switches tend to have it enabled.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Eichhorn18
Posts: 51
Joined: Wed Jan 17, 2018 9:52 am

Re: RPi 3B+ gigabit ethernet bad download speeds.

Thu Aug 30, 2018 2:57 pm

6by9 wrote:
Wed Aug 29, 2018 1:04 pm
Eichhorn18 wrote:
Wed Aug 29, 2018 12:35 pm
So I'm trying to transfer files through my local network, and scp from my windows machine is showing a max transfer speed of 11.5 MB/s.

What is required to check if flow control is turned on/off? I'm running an enterprise network through switches and some managed hubs.

Code: Select all

[email protected]:~ $ sudo ethtool -a eth0
Pause parameters for eth0:
Autonegotiate:	on
RX:		on
TX:		on
RX negotiated:	on
TX negotiated:	on
on = good. off = bad.
Most managed switches will have options to enable/disable flow control. Unmanaged switches tend to have it enabled.
Have done this today and all are reporting as 'on'. I tested my 3B+ several more times with speedtest-cli and getting average 145 Mbit/s download.
Seperatly I have copied an 800 MB file from the 3B+ to a network mounted folder on a windows machine, with gigabit ethernet. Time to copy was 63 seconds, giving a speed of approximately 14 MB/s or 110 Mbit/s. This seems far below the stated speed of the 3B+ of 300 Mbit/s max, but still you would expect better than this.

drgeoff
Posts: 9251
Joined: Wed Jan 25, 2012 6:39 pm

Re: RPi 3B+ gigabit ethernet bad download speeds.

Thu Aug 30, 2018 4:16 pm

Eichhorn18 wrote:
Thu Aug 30, 2018 2:57 pm
Seperatly I have copied an 800 MB file from the 3B+ to a network mounted folder on a windows machine, with gigabit ethernet. Time to copy was 63 seconds, giving a speed of approximately 14 MB/s or 110 Mbit/s. This seems far below the stated speed of the 3B+ of 300 Mbit/s max, but still you would expect better than this.
Copied from where on the 3B+? How fast can that place source data continuously?

Eichhorn18
Posts: 51
Joined: Wed Jan 17, 2018 9:52 am

Re: RPi 3B+ gigabit ethernet bad download speeds.

Fri Aug 31, 2018 11:46 am

drgeoff wrote:
Thu Aug 30, 2018 4:16 pm
Copied from where on the 3B+? How fast can that place source data continuously?
Copied from the SD card. I realize that in itself is an unfortunate bottleneck.

I have also written files that are stored in RAM, directly to a network mounted folder on a windows machine using CIFS. The transfer speed from RAM to the network folder (over a gigabit network and onto a gigabit enabled machine) was 30 MB/s, transferring 184MB of files in 6.13 sec.

Someone has suggested to me that running Stretch lite may have a different result. What do people think about that? I'm running Stretch Desktop at the moment.

drgeoff
Posts: 9251
Joined: Wed Jan 25, 2012 6:39 pm

Re: RPi 3B+ gigabit ethernet bad download speeds.

Fri Aug 31, 2018 1:09 pm

Eichhorn18 wrote:
Fri Aug 31, 2018 11:46 am
drgeoff wrote:
Thu Aug 30, 2018 4:16 pm
Copied from where on the 3B+? How fast can that place source data continuously?
Copied from the SD card. I realize that in itself is an unfortunate bottleneck.

I have also written files that are stored in RAM, directly to a network mounted folder on a windows machine using CIFS. The transfer speed from RAM to the network folder (over a gigabit network and onto a gigabit enabled machine) was 30 MB/s, transferring 184MB of files in 6.13 sec.
Well, from RAM you get 30 Mbyte/s. That is 240 Mbit/s which is approaching the expected max rate of ethernet on a RPi 3B+.

Eichhorn18
Posts: 51
Joined: Wed Jan 17, 2018 9:52 am

Re: RPi 3B+ gigabit ethernet bad download speeds.

Fri Aug 31, 2018 3:05 pm

drgeoff wrote:
Fri Aug 31, 2018 1:09 pm
Well, from RAM you get 30 Mbyte/s. That is 240 Mbit/s which is approaching the expected max rate of ethernet on a RPi 3B+.
It's true that is pretty decent. I wonder why the big difference (approximately 50%) for an internet connection that is supposed to give 800 Mbits/s on gigabit ethernet computers. What is the raspberry Pi doing for a speed test that it's not doing for a local network transfer--assuming the internet connection is not the limiting factor.

ajp2k19
Posts: 2
Joined: Tue Feb 19, 2019 1:31 pm

Re: RPi 3B+ gigabit ethernet bad download speeds.

Tue Feb 19, 2019 1:34 pm

Maybe I'm late to the party but here is what I have discovered so far...

https://www.snbforums.com/threads/slow- ... net.55114/

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6642
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RPi 3B+ gigabit ethernet bad download speeds.

Tue Feb 19, 2019 1:59 pm

ajp2k19 wrote:
Tue Feb 19, 2019 1:34 pm
Maybe I'm late to the party but here is what I have discovered so far...

https://www.snbforums.com/threads/slow- ... net.55114/
So the same statement that has been made many times over in this thread then. Yes the Pi 3B+ requires ethernet flow control to be on to give reliable results. You can use "sudo ethtool -a eth0" to confirm whether it is on or off.
There was an intention to back off down to 100Mbit/s should flow control fail to be negotiated, but there hasn't been much progress on that.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

ajp2k19
Posts: 2
Joined: Tue Feb 19, 2019 1:31 pm

Re: RPi 3B+ gigabit ethernet bad download speeds.

Tue Feb 19, 2019 2:14 pm

6by9 wrote:
Tue Feb 19, 2019 1:59 pm
ajp2k19 wrote:
Tue Feb 19, 2019 1:34 pm
Maybe I'm late to the party but here is what I have discovered so far...

https://www.snbforums.com/threads/slow- ... net.55114/
So the same statement that has been made many times over in this thread then. Yes the Pi 3B+ requires ethernet flow control to be on to give reliable results. You can use "sudo ethtool -a eth0" to confirm whether it is on or off.
There was an intention to back off down to 100Mbit/s should flow control fail to be negotiated, but there hasn't been much progress on that.
Thanks, I wasn't sure there was any consenus on it. Now I have to figure out if I can enable it directly on my router, probably not... :(

cdsgames
Posts: 2
Joined: Thu Apr 04, 2019 9:03 am

Re: RPi 3B+ gigabit ethernet bad download speeds.

Thu Apr 04, 2019 9:33 am

Any news on the fix ??

inShaneity
Posts: 2
Joined: Wed May 01, 2019 11:22 am

Re: RPi 3B+ gigabit ethernet bad download speeds.

Wed May 01, 2019 11:31 am

I just purchased a 3B+ yesterday and I'm also experiencing slow speeds. My ISP is rated at 400Mbs up/20 down. My Pi is connected through the PoE hat and also has 1 HDD drive connected to it that's using Samba for network access. Seeing some issues in here about Samba, not sure about the PoE hat though. Running latest Stretch.

Before any changes and running speetest-cli, I was averaging about 30Mbs. Then I read up on enabling ethernet flow control. I have a Unifi 16 port PoE switch, so it was easy to find that setting and enable it. Now the speeds are averaging 125Mbs. If the max of this Pi is 300Mbs, then I'm still not even half way there.

Seeing people bouncing to different threads but I haven't found a consistent answer yet. Again, mostly concerned on maybe it being the PoE Hat in my case. Either way, I tried the Samba fix of turning off rx and tx, but I got an error that it was permitted to do that, so that didn't work.

What are my next steps from here, if there are any? Let me know if you need more information and I can provide that when I get home from work today.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 22070
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi 3B+ gigabit ethernet bad download speeds.

Wed May 01, 2019 12:00 pm

Not sure what to suggest. There's nothing wrong with the Pi I suspect, all the standard things have helpped, so there's something in the rest of the system going on to prevent higher speeds.

EDIT: Can you try powering it via a different mechanism to see if the that helps?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

inShaneity
Posts: 2
Joined: Wed May 01, 2019 11:22 am

Re: RPi 3B+ gigabit ethernet bad download speeds.

Tue May 07, 2019 11:23 am

jamesh wrote:
Wed May 01, 2019 12:00 pm
Not sure what to suggest. There's nothing wrong with the Pi I suspect, all the standard things have helpped, so there's something in the rest of the system going on to prevent higher speeds.

EDIT: Can you try powering it via a different mechanism to see if the that helps?
After further testing: Disabling Samba, removing the HDD, disabling WiFi, and removing the PoE hat, nothing changed. Speeds were still constant at around 125Mbs. I messed with the ethtool and changed it to 100 full, got worse speeds. Changed it back to 1000 and I was back at 125Mbs.

Then I randomly stumbled upon a post, not sure it if was in this thread, that said to try and update the FW using sudo rpi-update. The FW updated from 4.16.x to 4.19.37, I believe and it updated successfully. Running another speedtest-cli, increased my speeds by double! I was now seeing a constant 225Mbs - 250Mbs with the PoE Hat.

I still feel like the speeds should still be faster than that though. I'll keep doing some more tests...

Return to “General discussion”