Skip to content

RobustMQ Bench CLI Guide

robust-bench is the benchmark CLI for RobustMQ.
At this stage, it supports MQTT and Meta API benchmark workloads.

1. Command Shape

bash
robust-bench mqtt <subcommand> [options]
robust-bench meta <subcommand> [options]

Supported <subcommand>:

  • conn: connection benchmark
  • pub: publish benchmark
  • sub: subscribe benchmark
  • meta placement-create-session: benchmark Meta CreateSession (write)
  • meta placement-list-session: benchmark Meta ListSession (read)

2. Common Options

  • --host: broker host, default 127.0.0.1
  • --port: broker port, default 1883
  • --count: number of clients, default 1000
  • --interval-ms: startup interval in milliseconds, mainly for pub/sub, default 0
  • --duration-secs: benchmark duration in seconds for pub/sub, default 60
  • --qos: QoS (0|1|2), default 0
  • --username / --password: optional credentials
  • --output: table|json, default table

3. Quick Examples

3.1 Connection benchmark

bash
robust-bench mqtt conn \
  --host 127.0.0.1 \
  --port 1883 \
  --count 10000 \
  --concurrency 1000 \
  --mode create

Or hold mode:

bash
robust-bench mqtt conn \
  --host 127.0.0.1 \
  --port 1883 \
  --count 10000 \
  --concurrency 1000 \
  --mode hold \
  --hold-secs 60

3.2 Publish benchmark

bash
robust-bench mqtt pub \
  --host 127.0.0.1 \
  --port 1883 \
  --count 1000 \
  --topic bench/%i \
  --payload-size 256 \
  --message-interval-ms 10 \
  --qos 1 \
  --duration-secs 120

3.3 Subscribe benchmark

bash
robust-bench mqtt sub \
  --host 127.0.0.1 \
  --port 1883 \
  --count 1000 \
  --topic bench/# \
  --qos 1 \
  --duration-secs 120

3.4 Meta write benchmark

Single mode:

bash
robust-bench meta placement-create-session \
  --host 127.0.0.1 \
  --port 1228 \
  --count 100000 \
  --concurrency 1000 \
  --timeout-ms 3000 \
  --output table

Batch mode (--batch-size sets sessions per gRPC request):

bash
robust-bench meta placement-create-session \
  --host 127.0.0.1 \
  --port 1228 \
  --count 100000 \
  --concurrency 1000 \
  --batch-size 100 \
  --timeout-ms 3000 \
  --output table

3.5 Meta read benchmark

bash
robust-bench meta placement-list-session \
  --host 127.0.0.1 \
  --port 1228 \
  --count 100000 \
  --concurrency 1000 \
  --timeout-ms 3000 \
  --output table

4. Output Details

The tool reports in two layers:

  1. Real-time output (every second):
    • ops/s
    • cumulative ops
    • success/failed/timeout/received
    • p95/p99 latency
  2. Final detailed report:
    • total/avg/peak throughput
    • success/error/timeout rates
    • latency percentiles (min/avg/p50/p95/p99/max)
    • error distribution
    • per-second timeline