I am looking for ways to test the net speed on a linux box with no GUI from the command line. I am not interested in tools like bmon/iftop/wget/curl especially from the upload side of things, for download it is pretty easy with wget on different targets and servers(places). But i am more interested in the upload side of things, which is the most important part of a server's bandwidth. I want to test the upload speed on different servers and places around the world just like you could do it by visiting speedtest.net using a browser with flash. If that tool can handle download speeds too that way then all the better then.
-
did you tried to search for an example of youtube video upload with curl ? – mpapis Dec 03 '10 at 00:03
-
that seems like a good option – Shinnok Dec 29 '10 at 11:57
6 Answers
I'm not aware of a way to do this without a cooperating remote server. If you upload data, it has to go somewhere... Sites like speedtest.net do exactly that (they have a data sink somewhere).
Provided you do have ssh access to a remote server with a download link somewhat faster than the upload link you want to test, you may achieve this rather simply with netcat :
On your remote server (let's assume IP 1.2.3.4) :
$ nc -kl 12345 > /dev/null
On the machine you want to test :
$ time nc 1.2.3.4 12345 < large-file
$ stat -c'%s' large-file
Divide the file size by the "real" time and you have an estimation of your speed.
Note that you only need to run nc once on the server, and it will accept any number of sequential tests. If you only want it to work once (for security reasons or whatever), omit the -k flag.

- 714
- 5
- 16
-
Add -q0 parameter to nc to make sure it exits after completion of the upload. – Adriaan Dec 20 '13 at 09:32
I took this from another post I found here and thought I would pass it on:
It looks like there is a tool available on sourceforge that uses speedtest.net from the terminal.
Terminal speedtest: http://sourceforge.net/projects/tespeed/

- 51
- 1
- 1
iperf
is a tool designed for this.
You run it on both sides of the connection and it can measure bandwidth either way, with TCP or UDP, and has many tweakable parameters.

- 95,191
- 9
- 106
- 122
-
Hmm..iperf automatically implies that i must have access to several other boxes in other networks or places around the world(which i don't have) in order to install it and test. Not exactly what i am looking for. While with wget i can download stuff freely from many places, with upload generally, you must have access and certain permissions on those servers. Thus i am looking for a method that doesn't require me to have access to other servers/boxes. Thanks. – Shinnok Nov 28 '10 at 17:13
speed testing using iperf is advisable if you want a command line tool for that. Iperf is an awesome tool because of the following reasons:
- It allows you to make parallel connections. It also can modify window
- size It reports the gitter and dropped packets.
- Refer the below link for the complete explanation.
I don't think that exists some command-line tool for this kind of test, but someone seems to have your same question, take a look at the solutions suggested there..

- 22,411
- 10
- 48
- 86
-
already browsed that thread..doesn't deliver and it's 70% offtopic. :-) The torrent method i was thinking about before reading that thread might provide reasonable answers to the issue. – Shinnok Nov 28 '10 at 17:51
-
yes, just download something large.. does your download program show the average download speed, doesn't it? – BlackBear Nov 28 '10 at 18:09