Danrancan
Posts: 39
Joined: Wed Jan 15, 2020 4:28 am
Location: Milwaukee, WI, USA
Contact: Website Twitter

Internet speed of Pi 4 and speed test from command line

Tue Feb 25, 2020 7:49 pm

1) What is the expected internet speed for the Ethernet as well as Wi-fi connections for a raspberry pi 4?
2) Is there any recommended or easy way to do an internet speed test from the command line on a headless Pi server?

Any suggestions or info is highly appreciated! Thank you!
Nerd-Tech - Exploring Technology, Computers, and Techno…
https://github.com/danrancan
dan@nerd-tech.net
https://nerd-tech.net
https://keybase.io/danran/
My Keybase Invite https://keybase.io/inv/5a35010417/

pcmanbob
Posts: 9298
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Internet speed of Pi 4 and speed test from command line

Tue Feb 25, 2020 8:24 pm

For internet speed testing try speed test cli

https://github.com/sivel/speedtest-cli
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

jahboater
Posts: 5680
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Internet speed of Pi 4 and speed test from command line

Tue Feb 25, 2020 8:26 pm

What do you mean by the "internet speed"?

You can easily measure the speed of the Pi's ethernet and Wifi on the local network with the "iperf" command.
To install it:-

sudo apt update
sudo apt install iperf

You will need to install it also on another computer on the network, preferable a fast PC with a GiGe ethernet connection.

See "man iperf" for details, but it is very simple.

There is then the speed from the router to remote websites, but that's another matter.
Pi4 8GB running PIOS64

User avatar
HawaiianPi
Posts: 5710
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Internet speed of Pi 4 and speed test from command line

Tue Feb 25, 2020 9:02 pm

In theory both the Wireless AC and Ethernet should be capable of Gigabit speeds. Wireless has more overhead, though, and of course there are range, interference and other losses to consider, so in actual use Ethernet will likely be faster.

However, it also depends on your ISP speed. I'm only on 100Mbps (up/down) so my Internet speed is about the same for both (but it's a bit more variable on wireless). If you don't have Gigabit Internet, you may not see much difference.

Regarding speedtest-cli, the version installed with pip3 is often newer (currently apt installs 2.0.2-1 vs pip3 2.1.2-1). That may or may not make a difference (there was a bug in an earlier version that gave low results on the apt version, but that may have been fixed by now).

As indicated above, using an Internet test is not a good indication of true network speed. For that you need to use a tool like iperf on your local network. But if all you care about is how fast pages on the Internet load, then speedtest-cli will tell you how fast your ISP connection is.

What about speedtest.net? On older models (up to the 3B+) the browser test overwhelms the SoC and yields poor results. It's less of a problem on the Pi4, but I still get slightly lower results than with speedtest-cli.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Danrancan
Posts: 39
Joined: Wed Jan 15, 2020 4:28 am
Location: Milwaukee, WI, USA
Contact: Website Twitter

Re: Internet speed of Pi 4 and speed test from command line

Wed Mar 11, 2020 9:25 pm

HawaiianPi wrote:
Tue Feb 25, 2020 9:02 pm
In theory both the Wireless AC and Ethernet should be capable of Gigabit speeds. Wireless has more overhead, though, and of course there are range, interference and other losses to consider, so in actual use Ethernet will likely be faster.

However, it also depends on your ISP speed. I'm only on 100Mbps (up/down) so my Internet speed is about the same for both (but it's a bit more variable on wireless). If you don't have Gigabit Internet, you may not see much difference.

Regarding speedtest-cli, the version installed with pip3 is often newer (currently apt installs 2.0.2-1 vs pip3 2.1.2-1). That may or may not make a difference (there was a bug in an earlier version that gave low results on the apt version, but that may have been fixed by now).

As indicated above, using an Internet test is not a good indication of true network speed. For that you need to use a tool like iperf on your local network. But if all you care about is how fast pages on the Internet load, then speedtest-cli will tell you how fast your ISP connection is.

What about speedtest.net? On older models (up to the 3B+) the browser test overwhelms the SoC and yields poor results. It's less of a problem on the Pi4, but I still get slightly lower results than with speedtest-cli.
Thank you for such a thorough answer!
So I believe that the bug for speedtest-cli still exists in the apt version. I installed it, and my speed is extremely low when testing with speedtest-cli. However, when I log into my pi with the GUI and run a speedtest from the web browser, it shows a much faster and probably more accurate speed. Which leads me to the question, how exactly do I install the PIP version? I am not very familar with pip.

My current use case for testing my connection is more or less making sure that the web server running on my pi loads web pages fast and can handle traffic. So I suppose the most important aspect of my question in specific is making sure that my web server can serve content as fast as my ISP allows. Any suggestions on how to test that specifically would be great too!

Thanks again for all of your help and answers! This is very valuable info! Much appreciated!
Nerd-Tech - Exploring Technology, Computers, and Techno…
https://github.com/danrancan
dan@nerd-tech.net
https://nerd-tech.net
https://keybase.io/danran/
My Keybase Invite https://keybase.io/inv/5a35010417/

User avatar
HawaiianPi
Posts: 5710
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Internet speed of Pi 4 and speed test from command line

Thu Mar 12, 2020 2:42 am

Danrancan wrote:
Wed Mar 11, 2020 9:25 pm
Which leads me to the question, how exactly do I install the PIP version?

Code: Select all

pip3 install speedtest-cli
If you have already installed the apt version, you can uninstall it (but you may have to replace the old location with a link to the new one).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Danrancan
Posts: 39
Joined: Wed Jan 15, 2020 4:28 am
Location: Milwaukee, WI, USA
Contact: Website Twitter

Re: Internet speed of Pi 4 and speed test from command line

Mon Mar 16, 2020 12:33 am

HawaiianPi wrote:
Thu Mar 12, 2020 2:42 am
Danrancan wrote:
Wed Mar 11, 2020 9:25 pm
Which leads me to the question, how exactly do I install the PIP version?

Code: Select all

pip3 install speedtest-cli
If you have already installed the apt version, you can uninstall it (but you may have to replace the old location with a link to the new one).
I uninstalled the old app using

Code: Select all

sudo apt purge speedtest-cli
and then reinstalled it using

Code: Select all

pip3 install speedtest-cli
. Now my speeds are significantly higher! Thank you so much for helping me find the solution here! Hopefully it will help future readers and other noobs!
Nerd-Tech - Exploring Technology, Computers, and Techno…
https://github.com/danrancan
dan@nerd-tech.net
https://nerd-tech.net
https://keybase.io/danran/
My Keybase Invite https://keybase.io/inv/5a35010417/

Jeggen
Posts: 3
Joined: Fri Apr 10, 2020 3:04 pm

Re: Internet speed of Pi 4 and speed test from command line

Mon Jun 01, 2020 11:13 pm

I'm curious about what kind of speeds you're getting. I am running the PIP version of speedtest-cli but cannot achieve anything over 650Mbs even with the Pi 4 being overclocked. I have testedy connection using the same port and cable on my laptop and can achieve 900Mbps and up to full 1Gb on the right conditions.

Malna314
Posts: 1
Joined: Sat Jun 27, 2020 2:23 pm

Re: Internet speed of Pi 4 and speed test from command line

Sat Jun 27, 2020 9:03 pm

OMV4 is running on my PI4B. Today I performed the speed test and I was surprised.
The speed is asymmetrical, but not in the usual way. The download speed is much slower than upload via WIFI. :o

--------------------------------------------------------------------
root@mediaserver:~# speedtest-cli
Retrieving speedtest.net configuration...
Testing from Digi TV (91.83.52.173)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by ZNET Telekom Zrt. (Gyor) [50.03 km]: 12.28 ms
Testing download speed................................................................................
Download: 18.54 Mbit/s
Testing upload speed....................................................................................................
Upload: 47.30 Mbit/s

I think download shall be at least as fast as upload.

What can be wrong ? Configuration ? Hardware ?

How can I fix it ?

Return to “Beginners”