LogoLogo
1.13.0
1.13.0
  • Welcome
  • Getting Started
  • Downloads
  • VerneMQ / MQTT Introduction
  • Installing VerneMQ
    • Installing on Debian and Ubuntu
    • Installing on CentOS and RHEL
    • Running VerneMQ using Docker
  • Configuring VerneMQ
    • Introduction
    • The VerneMQ conf file
    • Auth using files
    • Auth using a database
    • MQTT Options
    • MQTT Listeners
    • HTTP Listeners
    • Non-standard MQTT options
    • Websockets
    • Logging
    • Consumer session balancing
    • Plugins
    • Shared subscriptions
    • Advanced Options
    • Storage
    • MQTT Bridge
  • VerneMQ Clustering
    • Introduction
    • Inter-node Communication
    • Dealing with Netsplits
  • Live Administration
    • Introduction
    • Inspecting and managing sessions
    • Retained messages
    • Live reconfiguration
    • Managing Listeners
    • HTTP API
    • Tracing
  • Monitoring
    • Introduction
    • $SYSTree
    • Graphite
    • Netdata
    • Prometheus
    • Health Checker
    • Status Page
  • Plugin Development
    • Introduction
    • Session lifecycle
    • Subscribe Flow
    • Publish Flow
    • Enhanced Auth Flow
    • Erlang Boilerplate
    • Lua Scripting Support
    • Webhooks
  • Misc
    • Loadtesting VerneMQ
    • Not a tuning guide
    • Change Open File Limits
  • Guides
    • A typical VerneMQ deployment
    • VerneMQ on Kubernetes
    • Loadtesting VerneMQ
    • Clustering during development
    • Not a tuning guide
    • Change Open File Limits
Powered by GitBook
On this page
  • 1. Install MZBench
  • 2. Install vmq_mzbench
  • 3. Write vmq_mzbench scenario files

Was this helpful?

Edit on GitHub
Export as PDF
  1. Guides

Loadtesting VerneMQ

Loadtesting VerneMQ with vmq_mzbench

PreviousVerneMQ on KubernetesNextClustering during development

Last updated 1 year ago

Was this helpful?

You can loadtest VerneMQ with our . It is based on Machinezone's very powerful and lets you narrow down what hardware specs are needed to meet your performance goals. You can state your requirements for latency percentiles (and much more) in a formal way, and let vmq_mzbench automatically fail, if it can't meet the requirements.

If you have an AWS account, vmq_mzbench can automagically provision worker nodes for you. You can also run it locally, of course.

1. Install MZBench

Please follow the

2. Install vmq_mzbench

Actually, you don't even have to install vmq_mzbench, if you don't want to. Your scenario file will automatically fetch vmq_mzbench for any test you do. vmq_mzbench runs every test independently, so it has a provisioning step for any test, even if you only run it on a local worker.

To install vmq_mzbench on your computer, go through the following steps:

git clone git://github.com/erlio/vmq_mzbench.git
cd vmq_mzbench
./rebar get-deps
./rebar compile

To provision your tests from this local repository, you'll have to tell the scenario scripts to use rsync. Add this to the scenario file:

{make_install, [
{rsync, "/path/to/your/installation/vmq_mzbench/"},
{exclude, "deps"}]},

If you'd just like the script itself fetch vmq_mzbench, then you can direct it to github:

{make_install, [
{git, "git://github.com/erlio/vmq_mzbench.git"}]},

3. Write vmq_mzbench scenario files

There's not much to learn, just make sure you understand how pools and loops work. Then you can add the vmq_mzbench statement functions to the mix and define actual loadtest scenarios.

Currently vmq_mzbench exposes the following statement functions for use in MQTT scenario files:

  • random_client_id(State, Meta, I): Create a random client Id of length I

  • fixed_client_id(State, Meta, Name, Id): Create a deterministic client Id with schema Name ++ "-" ++ Id

  • worker_id(State, Meta): Get the internal, sequential worker Id

  • client(State, Meta): Get the client Id you set yourself during connection setup with the option {t, client, "client"}

  • connect(State, Meta, ConnectOpts): Connect to the broker with the options given in ConnectOpts

  • disconnect(State, Meta): Disconnect normally

  • subscribe(State, Meta, Topic, QoS): Subscribe to Topic with Quality of Service QoS

  • unsubscribe(State, Meta, Topic): Unubscribe from Topic

  • publish(State, Meta, Topic, Payload, QoS): Publish a message with binary Payload to Topic with QoS

  • publish(State, Meta, Topic, Payload, QoS, RetainFlag): Publish a message with binary Payload to Topic with QoS and RetainFlag

It's easy to add more statement functions to the MQTT worker if needed, get in touch with us.

MZBench recently switched from an Erlang-styled Scenario DSL to a more python-like DSL dubbed BDL (Benchmark Definition Language). Have a look at the on Github.

You can familiarize yourself quickly with on writing loadtest scenarios.

vmq_mzbench tool
MZBench system
MZBench installation guide
BDL examples
MZBench's guide