Giter Site home page Giter Site logo

mqtt_stress_tester's Introduction

Stress Tester

This is a MQTT broker stress tester designed to determine the capacity of a broker by bombarding it with concurrent messages.

This program is written in the Go programming language and was developed and tested with Go 1.6.

Prerequisites

You need to have Go installed. This program was tested with Go 1.6 and later versions should work. Earlier versions should as well, although are untested.

Building

Build this program with the command

make all

Testing

You can run the unit-tests with the command

make test

Running

The command-line usage can be requested with the --help or -h flags:

bash$ mqtt_stresser -h
Usage:
  mqtt_stresser [OPTIONS]

Broker Connection Options:
      --hostname=            Address of the broker to connect to (default:
                             localhost)
      --passwd-file=         File with raw-text usernames and passwords
  -u, --username=            Name of the user to connect with. Superceded by
                             --passwd-file if specified
  -P, --password=            Password of the user to connect with. Used in
                             tandem with username
  -p, --port=                The port to connect through (default: 1883)

Publish/Subscribe Options:
  -n, --num-publishers=      Number of concurrent publishers (default: 1)
  -m, --messages-per-second= Average number of messages per second to send from
                             each publisher (default: 10)
  -d, --duration=            Number of seconds to run the publishers for
                             (default: 5)
  -s, --message-size=        Average number of bytes per message. At least 8
                             needed to collect timing data (default: 50)
  -v, --msg-rate-variance=   Variance (seconds squared) of the sample of
                             message rates (default: 0.005)
  -V, --msg-size-variance=   Variance (messages squared) of the sample of
                             message sizes (default: 5)
  -t, --topic-prefix=        Prefix to add to all random topic names for each
                             publisher (default: test/)
  -i, --interval=            Interval (in seconds) between successive broker
                             connection attempts (default: 1)

Input/Output Files:
  -c, --ca-file=             Certificate authority to enable anonymous TLS
                             connection
  -o, --output=              Output file to write detailed pub/sub statistics
                             to (default: stdout)
  -y, --yaml=                Input file with command-line parameters in YAML
                             format. CL options override YAML input

Help Options:
  -h, --help                 Show this help message

The command-line options afford you the flexibility to publish more or fewer messages, at whatever rate you choose.

Alternative Input: YAML

If you do not want to specify all input options on the command-line, you can write a YAML-formatted input file whose keys are the same as the long command-line options shown above. An example file is shown below:

# Sample YAML file for input to mqtt_stresser. The YAML names are the same as
# the command-line flags (without the leading -- or short options)
hostname: somehost
passwd-file: passwd
username: username
password: password
port: 1985
num-publishers: 100
messages-per-second: 100
msg-rate-variance: 1.0
message-size: 100
msg-size-variance: 10
duration: 120
topic-prefix: sometopic/
ca-file: some.crt
output: some.csv

The way input is processed is that YAML files are processed first, and any other command-line arguments are processed second. Because of this order of operations, any command-line argument will override the contents of the YAML file for that particular input variable.

mqtt_stress_tester's People

Watchers

Jason Swails avatar James Cloos avatar

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.