RPIgoodSBC
Posts: 51
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 1787 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 1787 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: 6049
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: 6049
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: 8866
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: 8866
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.

Return to “General discussion”