nobozo
Posts: 7
Joined: Fri Jul 24, 2020 7:23 pm

Much Slower Than Expected Ethernet Speed

Sat Jul 25, 2020 12:34 am

Brand new RP4 8GB.

Linux raspberrypi 5.4.51-v7l+ #1327 SMP Thu Jul 23 11:04:39 BST 2020 armv7l GNU/Linux

I'm one of the lucky people who have 1Gbs internet connectivity. When I hook most computers to my local network and then go to
https://fast.com I generally see speeds between 900Mps and 1Gbs. Very nice!

If I unhook a cable that was plugged into a computer that showed the speed I mention above and then hook the cable to my RP4 I and go to https://fast.com on either Firefox or Chromium I generally see speeds between 100Mbs and 150Mbs. Nice, but not as nice as I'd expect.

Running ethtool shows that the interface is Speed: 1000Mb/s Duplex: Full

Running ifconfig shows

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.18 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::f3f2:dc5e:d520:3749 prefixlen 64 scopeid 0x20<link>
ether dc:a6:32:b8:b0:be txqueuelen 1000 (Ethernet)
RX packets 1169364 bytes 1749144596 (1.6 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 138931 bytes 11124996 (10.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

The system seems quite fast, and 150Mbs is certainly respectable. But, I wonder what's going on here. I did some Googling and a bunch of people are having similar problems which they attribute to the way the Gigabit ethernet adapter is connected using the USB3 channel.

What's the latest thinking about this problem?

Thanks,
Jon

cleverca22
Posts: 8194
Joined: Sat Aug 18, 2012 2:33 pm

Re: Much Slower Than Expected Ethernet Speed

Sat Jul 25, 2020 12:50 am

nobozo wrote:
Sat Jul 25, 2020 12:34 am
Brand new RP4 8GB.

The system seems quite fast, and 150Mbs is certainly respectable. But, I wonder what's going on here. I did some Googling and a bunch of people are having similar problems which they attribute to the way the Gigabit ethernet adapter is connected using the USB3 channel.
on the pi4, the gigabit ethernet doesnt use usb at all

what does `top` show the cpu usage is like, while running the speed test?

User avatar
rpdom
Posts: 22804
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Much Slower Than Expected Ethernet Speed

Sat Jul 25, 2020 7:42 am

cleverca22 wrote:
Sat Jul 25, 2020 12:50 am
nobozo wrote:
Sat Jul 25, 2020 12:34 am
Brand new RP4 8GB.

The system seems quite fast, and 150Mbs is certainly respectable. But, I wonder what's going on here. I did some Googling and a bunch of people are having similar problems which they attribute to the way the Gigabit ethernet adapter is connected using the USB3 channel.
on the pi4, the gigabit ethernet doesnt use usb at all

what does `top` show the cpu usage is like, while running the speed test?
I'd use `top -1` (yes, the number '1'), as that will show the usage of each cpu core separately so you can see if one is maxed out and the other three idle.
Unreadable squiggle

pica200
Posts: 294
Joined: Tue Aug 06, 2019 10:27 am

Re: Much Slower Than Expected Ethernet Speed

Sat Jul 25, 2020 5:21 pm

If the site uses TLS even for the test data then that's the bottleneck. Unfortunately the crypto extensions are missing from the Cortex-A72 cores used on the Pi 4.

nobozo
Posts: 7
Joined: Fri Jul 24, 2020 7:23 pm

Re: Much Slower Than Expected Ethernet Speed

Sun Jul 26, 2020 4:10 am

Thanks for all the comments.

You might be on to something as far as the TLS overhead is concerned. I followed the suggestion to monitor the CPU while connecting to https://fast.com. One CPU was usually pegged, and the others weren't far behind.

Ironically, when I did the same thing on my Windows 10 machine, even though I got ~950Gbs, the CPU (i5-4460s) was about 80%.

So, at first glance it appears that the RP4 has trouble with TLS overhead. On the other hand, some of the people in other discussions about this claim it has to do with the way the Gb network interface is connected.

My next step will be to find a pure HTTP network speed tester. That should remove the possibility of TLS overhead.

Jon

User avatar
rpdom
Posts: 22804
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Much Slower Than Expected Ethernet Speed

Sun Jul 26, 2020 8:25 am

nobozo wrote:
Sun Jul 26, 2020 4:10 am
On the other hand, some of the people in other discussions about this claim it has to do with the way the Gb network interface is connected.
The people who claim it is because the Gb network interface is connected to USB on the Pi 4B are wrong, as it doesn't use USB at all. It uses a dedicated 1Gb interface.

They would be correct on the Pi 3B+ which does use the 480Mb USB2.0 for the 1Gb network interface, but which is still a lot better than earlier Pis with USB2.0 driving a 100Mb interface.
Last edited by rpdom on Mon Jul 27, 2020 3:34 am, edited 1 time in total.
Unreadable squiggle

ganzgustav22
Posts: 334
Joined: Tue Feb 11, 2020 1:04 pm

Re: Much Slower Than Expected Ethernet Speed

Sun Jul 26, 2020 10:03 am

My next step will be to find a pure HTTP network speed tester. That should remove the possibility of TLS overhead.
Another option would be using "iperf" to test speed between the Pi and your Windows machine on your LAN.

nobozo
Posts: 7
Joined: Fri Jul 24, 2020 7:23 pm

Re: Much Slower Than Expected Ethernet Speed

Mon Jul 27, 2020 2:54 am

As suggested, I ran iperf3 between my RP4 and a Lenovo laptop running Fedora32. I'm happy to report that iperf3 showed a speed of 935 Mbits/sec in both directions. This appears to confirm the theory that the TLS overhead is the cause of the poor bandwidth numbers from the various web-based speed test sites.

It would be nice if the Raspberry OS documentation mentioned this somewhere since I'm clearly not the first person to notice this.

It would also be nice if the Raspberry Pi 5, whenever it comes out, includes hardware support for the necessary crypto extensions.

Thanks again to everyone who helped my on this issue.

Jon

Return to “General discussion”