How do I use your Speed Test?

Linode Staff

I find your Speed Test page confusing. It's just a bunch of links, with no instruction on how to actually obtain a speed from the downloads. How do I use this?

8 Replies

Our Speed Test is conducted using the 'wget' command from your local machine, run against the URLs that the links on the Speed Test site. What you do is copy the URL for each link you wish to test and run:

wget <url for the datacenter you are testing against>

where <url for the datacenter you are testing against> is the URL for the datacenter you are testing. For example:

wget http://speedtest.newark.linode.com/100MB-newark.bin

Alternatively, to test all of the datacenters at once, you can use a script, such as:

#!/bin/bash

readonly -a locations=("atlanta" \
                       "dallas" \
                       "frankfurt" \
                       "fremont" \
                       "london" \
                       "mumbai1" \
                       "newark" \
                       "singapore" \
                       "tokyo2" \
                       "toronto1")

readonly -a filenames=("atlanta" \
                       "dallas" \
                       "frankfurt" \
                       "fremont" \
                       "london" \
                       "mumbai" \
                       "newark" \
                       "singapore" \
                       "tokyo2" \
                       "toronto")

declare x=0

for i in "${locations[@]}"; do
    wget speedtest."${locations[$x]}".linode.com/100MB-"${filenames[$x]}".bin
    x=${x}+1
done

This script will test every one of our datacenters speed from your location. From there, you can decide which datacenter will best suit your needs. To run it, simply copy/paste the code into a text editor and save it with a filename like 'speedtest.sh'. You then need to give the script execute permissions:

chmod 755 speedtest.sh

From here, you can invoke the script by navigating to the directory in which it lives and running:

./speedtest.sh

where 'speedtest.sh' is whatever name you gave to the script.

I recommend running these tests from an area where most of your customers will connect to your server from, so you can ensure that they are provided with the best experience.

Please Note that while running all of the tests, that you will want to avoid streaming content or doing anything else on your network to avoid skewing the test results.

macOS / Linux

On macOS, you can copy the script below into your clipboard and then open a terminal. Because you can't have two things in your clipboard at once, you will need to type the following:

pbpaste > speedtest.pl

Under Linux, you will need to open your favorite text editor and paste the text into a new file called speedtest.pl and then save it.

You can then make your script executable and run it:

chmod 755 speedtest.pl
./speedtest.pl

Here is the script:

Linode Facilities Speedtest - macOS / Linux Version

#!/usr/bin/perl

use strict;
use Time::HiRes qw(time);

my @datacenters = qw(newark atlanta dallas fremont toronto1 frankfurt london singapore tokyo2 mumbai1);
my @filenames   = qw(newark atlanta dallas fremont toronto  frankfurt london singapore tokyo2 mumbai );
my @regions = ( "      US East (Newark, US)",
                "US Southeast (Atlanta, US)",
                "   US Central (Dallas, US)",
                "     US West (Fremont, US)",
                "  CA Central (Toronto, CA)",
                "EU Central (Frankfurt, DE)",
                "      EU West (London, UK)",
                "  AP South (Singapore, SG)",
                "  AP Northeast (Tokyo, JP)",
                "      AP West (Mumbai, IN)" );
system("clear");
print "             Linode Facilities Speedtest             \n";
print "                                                     \n";
print "           Region               Elapsed         ms   \n";
print "=====================================================\n";
for (my $i=0; $i<=9; $i++) {
    my $start = time;
    `curl -s http://speedtest.$datacenters[$i].linode.com/100MB-$filenames[$i].bin -o /dev/null`;
    my $end = time;
    my $elapsed = $end - $start;

    my $hh = int($elapsed) / ( 60 * 60 );
    my $rest = int($elapsed) % ( 60 * 60 );
    my $mm = $rest / 60;
    $rest = $rest % 60;
    my $ss = $rest;
    my $cc = $elapsed - int($elapsed);

    print "$regions[$i]:   ";
    printf ("%02d:%02d:%02d.%02d   %7dms\n", $hh, $mm, $ss, $cc*100, $elapsed*1000);
}

Windows

In Windows things are a little more complicated because there only native command to download files on all versions of Windows (beginning with Windows 7). You can copy and paste the following script into a batch file by opening a command prompt and typing:

notepad.exe speedtest.bat

Make sure you save the file after pasting.

Run the batch file by typing speedtest.bat from the commandline.

Linode Facilities Speedtest - Windows Version

@echo off
setlocal

:: Define Datacenter Subnetwork Name Information
set datacenters[0]=newark
set datacenters[1]=atlanta
set datacenters[2]=dallas
set datacenters[3]=fremont
set datacenters[4]=toronto1
set datacenters[5]=frankfurt
set datacenters[6]=london
set datacenters[7]=singapore
set datacenters[8]=tokyo2
set datacenters[9]=mumbai1

:: Define Datacenter Names in Filenames
set filenames[0]=newark
set filenames[1]=atlanta
set filenames[2]=dallas
set filenames[3]=fremont
set filenames[4]=toronto
set filenames[5]=frankfurt
set filenames[6]=london
set filenames[7]=singapore
set filenames[8]=tokyo2
set filenames[9]=mumbai

:: Define Region Names
set regions[0]=      US East (Newark, US)
set regions[1]=US Southeast (Atlanta, US)
set regions[2]=   US Central (Dallas, US)
set regions[3]=     US West (Fremont, US)
set regions[4]=  CA Central (Toronto, CA)
set regions[5]=EU Central (Frankfurt, DE)
set regions[6]=      EU West (London, UK)
set regions[7]=  AP South (Singapore, SG)
set regions[8]=  AP Northeast (Tokyo, JP)
set regions[9]=      AP West (Mumbai, IN)

:: Print Banner to Results File
@echo              Linode Facilities Speedtest            > SpeedTestResults.txt
@echo.                                                    >> SpeedTestResults.txt
@echo            Region               Elapsed       ms    >> SpeedTestResults.txt
@echo =================================================== >> SpeedTestResults.txt

:: Benchmark each datacenter in turn, each adding a line to the results file 
for /L %%i IN (0, 1, 9) DO CALL :benchmark %%i

:: Clear the screen and display the results
cls
type SpeedTestResults.txt

goto :eof

:: Benchmarking Function
:: ---------------------

:benchmark

:: Break apart the timestamp of when we start and do math things to
:: Turn things that look like this 11:07:48.85 into a number of seconds.

for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
    set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)

:: Tricky batch command magic to make arrays work

call set datacenter=%%datacenters[%1]%%
call set region=%%regions[%1]%%
call set filename=%%filenames[%1]%%

:: Generate a command to download the test file for this datacenter, using only commands provided by
:: the default Windows installation.

set command=bitsadmin /transfer speedtest%datacenter% /priority high http://speedtest.%datacenter%.linode.com/100MB-%filename%.bin "%TMP%\100MB-%filename%.bin"
%command%

:: Cleanpup after ourselves

del "%TMP%\100MB-%filename%.bin"

:: Break apart the timestamp of when we finish and do math things to
:: turn things that look like this 11:07:48.85 into a number of seconds.

for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
    set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)

:: Calclulate the elapsed number of seconds our test run took

set /A elapsed=end-start 

:: Do the reverse of the math things to put the number of seconds back into an elapsed time.

set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100

if %hh% lss 10 set hh=0%hh%
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%

:: Add a line to the results file for this datacenter.

echo %region%:   %hh%:%mm%:%ss%.%cc%   %elapsed%0ms >> SpeedTestResults.txt
EXIT /B 0

:eof

When it finishes the results will look like:

             Linode Facilities Speedtest

           Region               Elapsed         ms
=====================================================
      US East (Newark, US):   00:00:01.44      1446ms
US Southeast (Atlanta, US):   00:00:02.41      2412ms
   US Central (Dallas, US):   00:00:03.94      3949ms
     US West (Fremont, US):   00:00:05.77      5772ms
  CA Central (Toronto, CA):   00:00:03.97      3971ms
EU Central (Frankfurt, DE):   00:00:07.30      7301ms
      EU West (London, UK):   00:00:06.69      6690ms
  AP South (Singapore, SG):   00:00:16.22     16227ms
  AP Northeast (Tokyo, JP):   00:00:12.52     12527ms
      AP West (Mumbai, IN):   00:00:18.10     18103ms

I believe there's a typo for the mumbai datacenter. Currently, wget returns a 404 for its speedtest. The URL should be http://speedtest.mumbai1.linode.com/100MB-mumbai.bin rather than http://speedtest.mumbai1.linode.com/100MB-mumbai1.bin.
Note the correct filename is 100MB-mumbai.bin, not 100MB-mumbai1.bin. The filename entry "mumbai1" in the script should be changed to reflect this.

ySApt29pe8GA, you are correct that there is a typo in the script. I will reach out to get this corrected. I have updated the other two scripts to include the Toronto and Mumbai datacenters.

@ySApt29pe8GA, thank you for pointing that out. I've corrected the script, and everything is working correctly now when I run it:

--2019-09-19 07:23:39--  http://speedtest.mumbai1.linode.com/100MB-mumbai.bin
Resolving speedtest.mumbai1.linode.com (speedtest.mumbai1.linode.com)... 172.105.33.31
Connecting to speedtest.mumbai1.linode.com (speedtest.mumbai1.linode.com)|172.105.33.31|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104857600 (100M) [application/octet-stream]
Saving to: ‘100MB-mumbai.bin’

100MB-mumbai.bin                              100%[==============================================================================================>] 100.00M  4.76MB/s    in 32s

2019-09-19 07:24:11 (3.16 MB/s) - ‘100MB-mumbai.bin’ saved [104857600/104857600]

Another script, because scripts are all awesome! This script will emulate a larger download, if you wanted to test a longer sustained download time. You will need to edit the datacenter name to the datacenter that you wish to test. I used Dallas for the default:

#!/bin/bash
echo "This will test an emulated 10GB Download. Feel free to edit the loop to change the download size, and watch your disk space disappear!"
test="0"
while [ $test -ne 100 ]
do
  wget -O test$test.bin  http://speedtest.dallas.linode.com/100MB-dallas.bin
  ((test=test+1))
done

I would also suggest running this script with time before it, as this should give you an estimate easier. Assuming the script was saved as Speedtest.sh:

time ./Speedtest.sh

-smccabe

A couple of updates I wanted to include here:

Speed tests can now be done on our website, and don't need to be done via the command line.

  • Speed Test : This page is great for testing any data center
  • Global Infrastructure: This site provides links for speed tests, while also listing services available at each data center.

Additionally, we've added the Sydney data center. If you'd like to use wget for that, the command would be:

wget http://speedtest.syd1.linode.com/100MB-syd1.bin

It would be good if you could put the .bin file links back on the speedtest page. It's nice that you've added a web app to do speed tests inside a browser, but the raw HTTP method is more versatile. It doesn't require a browser and is a simpler methodology, as it consists of a single HTTP request to a static file.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct