Git Product home page Git Product logo

speedtest's Introduction

Speedtest

Simple down/upload bandwidth test in browser javascript.

It has a simple interface with only the essentials. There are no dependencies other than the binary files. It doesn't even require a backend language such as PHP and runs great on static hosting.

You simply upload the index.html file and generate the binary testing files. The number precision can be changed up to 3 decimals using the arrow keys on your keyboard.

Installation

Just clone the repo:

git clone https://github.com/fvdm/speedtest

Or download the index.html file:

wget https://raw.githubusercontent.com/fvdm/speedtest/master/index.html

Binary files

To keep the repository small I have not included the test binaries.

You can instantly generate them yourself:

# on linux
fallocate -l 1m 1mb.bin
fallocate -l 5m 5mb.bin
fallocate -l 10m 10mb.bin
fallocate -l 100m 100mb.bin
fallocate -l 1000m 1000mb.bin

# on macOS
mkfile -n 1m 1mb.bin
mkfile -n 5m 5mb.bin
mkfile -n 10m 10mb.bin
mkfile -n 100m 100mb.bin
mkfile -n 1000m 1000mb.bin

# on Windows
# Open the Command Prompt as Administrator
fsutil file createnew 1mb.bin 1000000
fsutil file createnew 5mb.bin 5000000
fsutil file createnew 10mb.bin 10000000
fsutil file createnew 100mb.bin 100000000
fsutil file createnew 1000mb.bin 1000000000

# others like Synology
dd if=/dev/zero of=1mb.bin bs=1 count=0 seek=1M
dd if=/dev/zero of=5mb.bin bs=1 count=0 seek=5M
dd if=/dev/zero of=10mb.bin bs=1 count=0 seek=10M
dd if=/dev/zero of=100mb.bin bs=1 count=0 seek=100M
dd if=/dev/zero of=1000mb.bin bs=1 count=0 seek=1000M

These commands only create the files in the filesystem. No bytes are actually written to the storage. The suffix m is megabytes and g is gigabytes and so on.

Note on testing

With these kind of tools you are testing the available bandwidth of the slowest connection between your device and the host. When your web server connection is slower than your own network, you are actually testing the server's bandwidth instead of your own.

There can be many causes for slow connections, like the type of wiring, other devices, interference, packetloss or the peering between network providers somewhere along the route.

For example, I tested this speedtest from my own server to my home network both connected from Amsterdam and I got only 70 Mbit but using my provider's speedtest I get double at least. Doing the same to my LiquidSky box in Frankfurt I easily get over 900 Mbit. So there is a bottleneck somewhere between the web server and my home ISP.

The speedtest is at its best when the connection is as short as possible. For example, on your NAS or RPi to check on your LAN bandwidth.

Unlicense

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to https://unlicense.org/

Author

Franklin

Do you like this project? Please consider to buy me a coffee.

speedtest's People

Contributors

fvdm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

speedtest's Issues

Creating bin files on Windows

This is great! Just wanted to drop a note that Windows also has a tool for creating bin files from the command line. The Command Prompt must be opened as Administrator, but then you can just do this:

fsutil file createnew 1mb.bin 1000000
fsutil file createnew 5mb.bin 5000000
fsutil file createnew 10mb.bin 10000000
fsutil file createnew 100mb.bin 100000000
fsutil file createnew 1000mb.bin 1000000000

tweak dd instructions for reduced disk usage

You might want to change the 'dd' instructions a bit. If you use sparse files, you can have each file only consume one block of storage on the disk while having a much bigger file. To do this, you write a single block with dd and "seek" to the last block of the file.

For instance:

   dd if=/dev/zero of=1mb.bin   bs=1024 count=1 seek=$((  1*(1<<10) - 1))
   dd if=/dev/zero of=5mb.bin   bs=1024 count=1 seek=$((  5*(1<<10) - 1))
   dd if=/dev/zero of=10mb.bin  bs=1024 count=1 seek=$(( 10*(1<<10) - 1))
   dd if=/dev/zero of=100mb.bin bs=1024 count=1 seek=$((100*(1<<10) - 1))

$ ls -l *.bin; du -cs *.bin
-rw-rw-r-- 1 dave dave 1048576000 May  3 10:25 1000mb.bin
-rw-rw-r-- 1 dave dave  104857600 May  3 10:15 100mb.bin
-rw-rw-r-- 1 dave dave   10485760 May  3 10:15 10mb.bin
-rw-rw-r-- 1 dave dave    1048576 May  3 10:26 1mb.bin
-rw-rw-r-- 1 dave dave    5242880 May  3 10:15 5mb.bin
4	1000mb.bin
4	100mb.bin
4	10mb.bin
8	1mb.bin
4	5mb.bin
24	total

'du' shows the true on-disk storage size of the files.

missing comma in "dec" function

this line is missing in the second if

     res += '.';
        if ( ! flo && diff ) {
          res += '.';
          for ( let i = 0; i < diff; i++ ) {
            res += '0';
          }
        }

        if ( flo && diff > 0 ) {
          for ( let i = 0; i < diff; i++ ) {
            res += '0';
          }
        }

should be change to

        if ( ! flo && diff ) {
          res += '.';
          for ( let i = 0; i < diff; i++ ) {
            res += '0';
          }
        }

        if ( flo && diff > 0 ) {
          res += '.';
          for ( let i = 0; i < diff; i++ ) {
            res += '0';
          }
        }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.