Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


command line speedtest.net via tespeed
New on LowEndTalk? Please Register and read our Community Rules.

command line speedtest.net via tespeed

albuckalbuck Member
edited December 2012 in General

I recently got my Raspberry Pi after five months on the waiting list. I was running it headless via ssh, but I wanted to know its networking speed. After a bit a googling, I found "tespeed", a command line interface to the actual speedtest.net servers:

https://github.com/Janhouse/tespeed

It worked nicely, and I also started measuring the speeds of my various linux lowendboxen. It works very nicely after adding the python-lxml module to stock Python on debian installations. It's interesting to watch speedtest.net increase the transfer size by a factor of two at each stage.

Comments

  • SpeedBusSpeedBus Member, Host Rep

    Thanks for the link and info, was looking for something like this to use from ssh :)

  • awesome.. it says 400MB download and 202MB upload.. @Simplenode

  • Neat find. Seemingly pretty alpha stage software.

    A tad confusing on the output. I get this:

    Download speed: 226.45 Mbit/s
    Download size: 16.18 MiB; Downloaded in 0.03 s
    Download speed: 506.35 Mbit/s
    Download size: 35.78 MiB; Downloaded in 0.07 s
    Download speed: 518.21 Mbit/s
    Download size: 63.56 MiB; Downloaded in 0.10 s
    Download speed: 646.71 Mbit/s
    Download size: 142.98 MiB; Downloaded in 0.23 s
    Download speed: 633.88 Mbit/s
    Download size: 253.05 MiB; Downloaded in 0.42 s
    Download speed: 596.00 Mbit/s
    Download size: 379.57 MiB; Downloaded in 0.90 s
    Download speed: 421.00 Mbit/s
    Download size: 595.58 MiB; Downloaded in 1.40 s
    Download speed: 424.15 Mbit/s
    Download size: 855.21 MiB; Downloaded in 2.05 s
    Download speed: 416.47 Mbit/s
    Download size: 1164.58 MiB; Downloaded in 2.78 s
    Download speed: 419.66 Mbit/s
    Download size: 2024.02 MiB; Downloaded in 6.41 s
    Download speed: 315.75 Mbit/s
    Upload size: 2.10 MiB; Uploaded in 0.03 s
    Upload speed: 64.97 Mbit/s
    Upload size: 2.10 MiB; Uploaded in 0.03 s
    Upload speed: 65.40 Mbit/s
    Upload size: 4.19 MiB; Uploaded in 0.05 s
    Upload speed: 77.21 Mbit/s
    Upload size: 4.19 MiB; Uploaded in 0.05 s
    Upload speed: 86.31 Mbit/s
    Upload size: 16.78 MiB; Uploaded in 0.10 s
    Upload speed: 168.41 Mbit/s
    Upload size: 16.78 MiB; Uploaded in 0.08 s
    Upload speed: 204.32 Mbit/s
    Upload size: 134.22 MiB; Uploaded in 0.60 s
    Upload speed: 224.78 Mbit/s
    Upload size: 134.22 MiB; Uploaded in 0.58 s
    Upload speed: 231.01 Mbit/s
    Upload size: 134.22 MiB; Uploaded in 0.57 s
    Upload speed: 235.21 Mbit/s
    Upload size: 134.22 MiB; Uploaded in 0.58 s
    Upload speed: 232.52 Mbit/s

    Otherfolks seeing similar when testing? Do we just take the last value as the speed?

  • @pubcrawler: appears to be the last "Download size" file that it's showing.

    Getting ready. Use parameter -h or --help to see available features.
    Loading speedtest configuration...
    IP: 198.144.190.10; Lat: 42.986400; Lon: -78.727900; ISP: ColoCrossing
    Loading server list...
    Looking for closest and best server...
    Testing latency...
    29 ms latency for http://68.71.31.19/speedtest/speedtest/ (NRBN, St. Catharines, ON, Canada) [56.32 km]
    32 ms latency for http://98.124.42.210/speedtest/ (Nexicom Inc., Toronto, ON, Canada) [69.82 km]
    40 ms latency for http://speedtest.teksavvy.com/speedtest/ (TekSavvy Solutions, Toronto, ON, Canada) [69.82 km]
    36 ms latency for http://speedtest.beanfield.com/speedtest/ (Beanfield Metroconnect, Toronto, ON, Canada) [77.87 km]
    42 ms latency for http://speedtest.blink.ca/speedtest/ (Blink Communications Inc., Oakville, ON, Canada) [107.09 km]
    Best server with average latency 29ms - NRBN, St. Catharines, ON, Canada
    Download size: 3.93 MiB; Downloaded in 0.22 s
    Download speed: 18.16 Mbit/s
    Download size: 16.18 MiB; Downloaded in 0.33 s
    Download speed: 49.76 Mbit/s
    Download size: 35.78 MiB; Downloaded in 0.67 s
    Download speed: 53.30 Mbit/s
    Download size: 63.56 MiB; Downloaded in 1.15 s
    Download speed: 55.06 Mbit/s
    Download size: 142.98 MiB; Downloaded in 2.24 s
    Download speed: 63.97 Mbit/s
    Download size: 253.05 MiB; Downloaded in 3.19 s
    Download speed: 79.36 Mbit/s
    Download size: 379.57 MiB; Downloaded in 4.85 s
    Download speed: 78.22 Mbit/s
    Download size: 595.58 MiB; Downloaded in 7.61 s
    Download speed: 78.24 Mbit/s
    Upload size: 2.10 MiB; Uploaded in 0.30 s
    Upload speed: 7.07 Mbit/s
    Upload size: 2.10 MiB; Uploaded in 0.32 s
    Upload speed: 6.58 Mbit/s
    Upload size: 4.19 MiB; Uploaded in 0.38 s
    Upload speed: 11.00 Mbit/s
    Upload size: 4.19 MiB; Uploaded in 0.34 s
    Upload speed: 12.38 Mbit/s
    Upload size: 16.78 MiB; Uploaded in 0.47 s
    Upload speed: 35.84 Mbit/s
    Upload size: 16.78 MiB; Uploaded in 0.62 s
    Upload speed: 27.25 Mbit/s
    Upload size: 134.22 MiB; Uploaded in 2.84 s
    Upload speed: 47..34 Mbit/s
    Upload size: 134.22 MiB; Uploaded in 2.82 s
    Upload speed: 47.61 Mbit/s
    Upload size: 134.22 MiB; Uploaded in 2.77 s
    Upload speed: 48.45 Mbit/s
    Upload size: 134.22 MiB; Uploaded in 2.76 s
    Upload speed: 48.65 Mbit/s
    
  • @pubcrawler said: Otherfolks seeing similar when testing? Do we just take the last value as the speed?

    Well, if you check the README at git, you can see that the script uses the 5 nearest locations. VPSeS are inside Datacenters.. so the nearest locations probably is another datacenter in the same US-state. That means sholdn't be used as a "real" speed to users from your server. Maybe you can use the value with less speed as the "minimum speed" to someone close to your server.

  • DestroyeRCoDestroyeRCo Member
    edited December 2012
    Download size: 3.93 MiB; Downloaded in 0.04 s
    Download speed: 91.50 Mbit/s
                                                                                    
    Download size: 16.18 MiB; Downloaded in 0.09 s
    Download speed: 173.89 Mbit/s
                                                                                    
    Download size: 35.78 MiB; Downloaded in 0.19 s
    Download speed: 189.21 Mbit/s
                                                                                    
    Download size: 63.56 MiB; Downloaded in 0.38 s
    Download speed: 168.59 Mbit/s
                                                                                    
    Download size: 142.98 MiB; Downloaded in 1.00 s
    Download speed: 143.36 Mbit/s
                                           
    Download size: 253.05 MiB; Downloaded in 0.73 s
    Download speed: 346.45 Mbit/s
                                                                                    
    Download size: 379.57 MiB; Downloaded in 0.98 s
    Download speed: 388.38 Mbit/s
                                                                                    
    Download size: 595.58 MiB; Downloaded in 1.50 s
    Download speed: 397.21 Mbit/s
                                                                                    
    Download size: 855.21 MiB; Downloaded in 2.93 s
    Download speed: 292.12 Mbit/s
                                                                                    
    Download size: 1164.58 MiB; Downloaded in 2.96 s
    Download speed: 392.96 Mbit/s
                                                                                    
    Download size: 2024.02 MiB; Downloaded in 6.21 s
    Download speed: 326.13 Mbit/s
                                                                                    
    Upload size: 2.10 MiB; Uploaded in 0.08 s
    Upload speed: 27.20 Mbit/s
                                                                                    
    Upload size: 2.10 MiB; Uploaded in 0.08 s
    Upload speed: 27.62 Mbit/s
                                                                                    
    Upload size: 4.19 MiB; Uploaded in 0.09 s
    Upload speed: 44.61 Mbit/s
                                                                                    
    Upload size: 4.19 MiB; Uploaded in 0.11 s
    Upload speed: 38.41 Mbit/s
                                                                                    
    Upload size: 16.78 MiB; Uploaded in 0.19 s
    Upload speed: 88.79 Mbit/s
                                                                                    
    Upload size: 16.78 MiB; Uploaded in 0.17 s
    Upload speed: 99.14 Mbit/s
                                               
    Upload size: 134.22 MiB; Uploaded in 0.66 s
    Upload speed: 202.96 Mbit/s
                                                                                    
    Upload size: 134.22 MiB; Uploaded in 0.67 s
    Upload speed: 199.85 Mbit/s
                                                                                    
    Upload size: 134.22 MiB; Uploaded in 0.66 s
    Upload speed: 202.39 Mbit/s
                                                                                    
    Upload size: 134.22 MiB; Uploaded in 0.68 s
    Upload speed: 196.84 Mbit/s
    
  • Running it with the -w and -s switches yield:

    79.54,47.91,"Mbit","http://68.71.31.19/speedtest/speedtest/"

    As the only output. Appears to be the highest numbers from the tests that it runs.

  • Interesting @Damian. I am short on RTFM today :)

    Promising tool even if a bit off in some way.

  • the -s and -w combo is interesting.

    The no output at runtime though leaves you hanging and wondering :)

    command: python tespeed.py -s -w

    660.05,239.69,"Mbit","http://spt01sghlga.sghl.ga.charter.com/speedtest/"

  • Indeed, but it would be good for monitoring via Munin or Observium or something. I considered a Munin graph, but it would probably ruin my commit.

  • JanhouseJanhouse Member
    edited December 2012

    Hi guys!
    Thanks for noticing it! :)

    I did some work on it tonight to get better results on boxes with >100Mbit connections.

    I would suggest collecting data for drawing graphs by running a cronjob with something like ./tespeed.py -w -s >> data.csv (you might also want to add a timestamp).

    This is one example of how someone uses it: https://docs.google.com...
    (Scroll to the right to see the graph.)

    You can read more about it on
    https://github.com/masteinha...
    and
    https://github.com/jaekwo...

    By the way, you can also use only -w flag and still send the output to file. Everything except the CSV data is written to STDERR.
    So ./tespeed.py -w >> data.csv will write the same thing as ./tespeed.py -w -s >> data.csv. In the 1st case you will also be able to monitor the output as the test is happening.

    Line for cronjob:
    echo date +%s,date +'%d/%m/%Y %H:%M:%S',python /home/user/tespeed/tespeed.py -w -s >> /home/user/tespeed.csv

  • Nifty examples :)

    Welcome aboard @Janhouse!

  • @Janhouse said: Hi guys!

    Thanks for noticing it! :)

    >
    Welcome to our community! Your tespeed script is very nice, thank you for it!

  • Not too bad.

    565.43,429.39,"Mbit","['http://speedtest.vodafone-ip.de/speedtest/']"

  • Thanks very much! This is very helpful. I made a post about this on : pythonforbeginners.com so that more Python people can use it :) I hope you don't mind.

  • The output I see here suggests the script's author has some confusion over bits and bytes...

  • A typo maybe? About mebibytes (not mebibits?)
    :D

  • flyfly Member

    cool. I wouldn't recommend using speedtest.net's servers tho, cuz sometimes they are overloaded. I would recommend using provider speedtests such as linode, etc.

  • krokro Member

    Accurate speed must be substained longer than 7 secs. Malware 101...

  • @fly

    linode? screw that. softlayer bro.

Sign In or Register to comment.