Console tool to test internet bandwidth

31,531

Solution 1

ttcp is a simple, possibly too simple, speed test utility.

pchar is another one people cite a lot, I've had bad luck with it, personally.

Here's how I'd use ttcp. You need two machines, each with ttcp (http://playground.sun.com/pub/tcp-impl/ttcp/ttcp.c) compiled on them.

HostA % ./ttcp -r -s -p 9401 
...

HostB % ./ttcp -s -p 9401 < /boot/vmlinuz

Once you've figured out how to get it to run, try different length files to see how speed varies. Use UDP (-u flag on both reader and sender command line) for even more fun!

Solution 2

I'm just repeating the answers listed on this (deleted?) stackoverflow question: https://stackoverflow.com/questions/426272/how-to-test-internet-connection-speed-from-command-line

k2z:

wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip

or

git clone https://github.com/sivel/speedtest-cli
cd speedtest-cli 
python2.7 speedtest_cli.py

Then you have the exact style results from speedtest.net with cli.

petermolnar:

You could use iperf to test the speed between two machines, since 'iperf' was designed to measure bandwidth.

on machine1 (host, this one will receive)

iperf -s -p 65000

on machine2 (client, this one will upload)

iperf -c [ip of server] -p 65000

Reverse the machines to test the other way (upload->download or vice versa).

billcarroll:

It looks like there is a tool available on sourceforge that uses speedtest.net from the terminal.

Terminal speedtest: http://sourceforge.net/projects/tespeed/

Solution 3

You might be interested in TeSpeed. It is described as:

If you are looking for tool that is able to test internet connection speed fron Linux terminal, you have found it! :) TeSpeed uses speedtest.net servers to check upload and download rate and it puts that information on charts.

http://tespeed.sourceforge.net/

Solution 4

Very basic, but I use a simple shellscript to download a 10MB file from my provider or nearby FTP-server:

#!/bin/sh

wget ftp://ftp.xs4all.nl/pub/test/10mb.bin ; rm 10mb.bin
## debian.unnet.nl is down...
#wget http://debian.unnet.nl/speedtest/10mb.bin ; rm 10mb.bin
#curl -LO http://debian.unnet.nl/speedtest/10mb.bin ; rm 10mb.bin

The output will look like this:

($:~)-> speedcheck.sh 
--2011-06-27 23:36:21--  ftp://ftp.xs4all.nl/pub/test/10mb.bin
           => `10mb.bin'
Resolving ftp.xs4all.nl (ftp.xs4all.nl)... 194.109.21.26
Connecting to ftp.xs4all.nl (ftp.xs4all.nl)|194.109.21.26|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD (1) /pub/test ... done.
==> SIZE 10mb.bin ... 10485760
==> PASV ... done.    ==> RETR 10mb.bin ... done.
Length: 10485760 (10M) (unauthoritative)

100%[===================================================>] 10,485,760  1.09M/s   in 9.8s    

2011-06-27 23:36:31 (1.02 MB/s) - `10mb.bin' saved [10485760]

Use wget or curl as shown in the script according to your wishes and try to find a server more close to your region (Slovenia). Most are in NL, but maybe .IT will fit your needs: http://www.filewatcher.com/m/10mb.bin.10485760.0.0.html

Solution 5

You can also try http://dl.getipaddr.net

They use curl (which is a well known command line utility) to run a speed test.

The code is published on GitHub as well. In short,

wget https://raw.github.com/blackdotsh/curl-speedtest/master/speedtest.sh && chmod u+x speedtest.sh && bash speedtest.sh

Share:
31,531

Related videos on Youtube

giZm0
Author by

giZm0

Student of Computer Science

Updated on September 18, 2022

Comments

  • giZm0
    giZm0 over 1 year

    I'm looking for a tool that will test my internet connection bandwidth and create an simple report like speedtest does.

    Do you know some program/tool that do this? Something with CentOS packages would be nice.

  • giZm0
    giZm0 almost 13 years
    can you give me an example how to use ttcp?
  • giZm0
    giZm0 almost 13 years
    If I don't have 2 machines?
  • Admin
    Admin almost 13 years
    If you don't have two machines, ttcp is worthless. It just sends a specified number of bytes over TCP or UDP as fast as it cam, and reports how long it took. Too simple, like I wrote above.
  • giZm0
    giZm0 almost 13 years
    I try it, but it doesn't work...
  • J.C. Yamokoski
    J.C. Yamokoski almost 13 years
    @wolfy, can you give me some more details? error messages perhaps...
  • giZm0
    giZm0 almost 13 years
    Thanks for this. Do you know how can I measure my upload?
  • Henk
    Henk almost 13 years
    Try using cURL. Look into the cURL manpage under uploading: cs.sunysb.edu/documentation/curl/index.html and improve / enhance the above script yourself ;-)
  • giZm0
    giZm0 almost 13 years
    when I run it, it only print that it starts testing and quit... no error, no info... maybe something in code is missing... I corrected the full path to speedtest.php, but this doesn't helped...
  • J.C. Yamokoski
    J.C. Yamokoski almost 13 years
    sounds like it might be dying when it attempts to run curl_init. run "php -m | grep curl" to make sure you have the curl module installed and if not that would be your problem.
  • giZm0
    giZm0 almost 13 years
    I will try and let you know :)
  • giZm0
    giZm0 almost 13 years
    OK, now I have curl module, but when it runs I get: download: 0 M/s (but I have 2M)... then testing upload and nothing...
  • Janhouse
    Janhouse over 11 years
    It has been updated and moved to Github. github.com/Janhouse/tespeed
  • ekoeppen
    ekoeppen over 11 years
    This would be considered as link only answer. Add more elaborative info from the link to your answer.
  • manatwork
    manatwork about 11 years
    Offtopic, but if somebody has no git installed, wget https://github.com/sivel/speedtest-cli/archive/master.zip seems easier then installing git just to clone.