Home

Awesome

Build Status

:radio: WebSocket Benchmarker :watch:

Message throughput is how fast a WebSocket server can parse and respond to a message. Some people consider this to be a good reference of a framework/library/server's performance. This tool measures the message throughput under load by mocking concurrent clients.

<br>

<br>
2019.01.26

Now with 100% more bleeding edge :zap: asyncio goodness.


<br>

Installation

Python 3.6.5+.

pip install -r requirements.txt

<br>

Usage

This program expects the host to be an echo server and measures the time between sending a message and recieving the same message back from the host. It performs this for a number of client connections simultaneously and is designed to produce repeatable results.

python bench.py will launch the benchmark and print statistics to stdout. If the log file path is to a non-file then one will be created otherwise results will be appended to the existing file.

The raw results are in CSV format with each line representing a client's roundtrip times.

E.g., 0.1, 0.1, 0.1 for one client performing three roundtrips.

<br>
ArgDescriptionDefault
--hHost address of WebSocket serverlocalhost:3000
--nNumber of clients to create1000
--cNumber of concurrent clients64
--rRoundtrips per client5
--sMessage size in characters30
--lPath to create or append to a log file./log.txt
<br>

Tests

Full end-to-end testing via unittest.

python -m unittest
...
----------------------------------------------------------------------
Ran 3 tests in 8.371s

OK
<br>

License

MIT (c) 2019 healeycodes.

Inspiration taken from the unmaintained JavaScript project websocket-benchmark.