Sunday, May 20, 2012

How to test Internet connection speed from command line?


There's plenty of websites for it, but they're all Flash, not of much use for servers without graphics mode. Any tool I can use to test up/down bandwidth from Linux command line?



Source: Tips4all

15 comments:

  1. I usually just find a large file somewhere (such as a Linux distro ISO) and use ftp or wget to download it.

    I don't think FTP gives you a figure until it's finished, but wget gives you a running commentary.

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

    ReplyDelete
  3. Old question, though this solution is missing from the answers.
    You could use iperf to test the speed between the to 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 vica versa).

    ReplyDelete
  4. I prefer the stats from curl

    curl -o /dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip

    ReplyDelete
  5. ab - the apache benchmark tool comes with most installs of apache, can be used to test downstream bandwidth. You could probably use curl for upstream tests

    ReplyDelete
  6. Pick a large file from a fast source and grab it using wget or curl, A good file to download is Windows XP SP2, large file size and Microsoft's servers allow a very high download speed, unlike some providers who set a per download speed cap.

    ReplyDelete
  7. If you have access to a unix shell on a server somewhere, you can use SCP to move a file between your computer and the server and vice-versa. It gives you the speed of the file transfer.

    ReplyDelete
  8. Try http://speedof.me

    This site is not flash-based. As it is based on html5 technology, it can be run from any browser on any OS.

    ReplyDelete
  9. An easy way would be to time wget/curl then divide the filesize by the time.

    eg. 654mb linux distro -- 20 mins

    32.7 mb/min

    558.08 kb/sec

    ReplyDelete
  10. Guys,
    I think you can use "iftop" package... you can download the rpm on http://checksuite.sourceforge.net/dl/.

    cheers

    Linox

    ReplyDelete
  11. iftop is the way to go, but require libpcap and ncurses: ex-parrot.com/~pdw/iftop/

    It is of course a linux utility, but a port is available for OSX via: macports.org/ports.php?by=name&substr=iftop

    ReplyDelete
  12. curl 'http://speedtest.wdc01.softlayer.com/downloads/test500.zip' -o test.zip

    ReplyDelete
  13. I have not reached speed limit at other end here - curl -o /dev/null http://download.thinkbroadband.com/1GB.zip

    ReplyDelete
  14. Another tool that seems to be built for exactly this use is Netperf, although it seems really complicated. After reading docs for half an hour I gave up and wrote my own.

    ReplyDelete
  15. Well I am faced with the same problem and I've decided that the only exhaustive way to test my internet speed is to use a bittorrent client.

    Otherwise you never know if it's the route you are using and there might a problem with any specific set of routes however if instead you use a bit torrent client you can find out exactly how many bits the internet can stuff down your pipes (and vice versa) if we are trying really hard.

    Selecting the correct torrent file is an exercise left up to the reader. I wanted wiki leaks but I think I'm going to have to go with some os torrent because I want something reliable.

    ReplyDelete