Git Product home page Git Product logo

httpbwtest's Introduction

HTTP bandwidth tester

Docker Repository on Quay.io

This is a simple and efficient web server to either send or retrieve arbitrary amounts of data. Useful for testing in cases where something like iperf is unfeasible or insufficient (eg proxy servers).

Installation

go get https://github.com/acobaugh/httpbwtest

Usage

./httpbwtest

or

docker run -p 8080:8080 quay.io/acobaugh/httpbwtest

Optionally, the PORT environment variable can be specified to change the port the server listens on. Default is 8080.

API

GET /:pattern?size=N

Sends size bytes of data.

Pattern is one of:

  • random
  • lohi (0xaf)
  • hilo (0xaa)
  • lohi (0x55)
  • fs (0xff)
  • zeros (0x00) - this is the default if / or any other value is requested

size is a human-readable size. If unspecified, defaults to 1B.

POST /

Accepts Content-Type: multipart/form-data. Immediately discards any file data sent on the form field named data.

Examples

Request 1GB of zeros.

% curl "localhost:8080/?size=1G" -o /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  953M    0  953M    0     0   718M      0 --:--:--  0:00:01 --:--:--  718M

Post 1GB of empty data.

% dd if=/dev/zero bs=1M count=1000 | curl -s -XPOST localhost:8080 -F data=@- -w"\nsize = %{size_upload}B\nspeed = %{speed_upload}B/s"
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 1.66935 s, 628 MB/s
ok
size = 1048576153B
speed = 409280309.000B/s

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.