Skip to content

Benchmark Report

This document records benchmark results for RobustMQ components, for regression comparison and performance tracking.


1. Meta Service

1.1 Single-Node Raft Write (placement-create-session)

Environment

ItemValue
MachineMacBook Pro (Apple Silicon)
DeploymentSingle node (Meta + Broker in one process)
Builddebug (cargo run)
Storage EngineRocksDB

Command

bash
cargo run --package cmd --bin cli-bench meta placement-create-session \
  --host 127.0.0.1 \
  --port 1228 \
  --count 1000000 \
  --concurrency 5000 \
  --timeout-ms 3000 \
  --output table

Key Metrics

MetricValue
Total Requests1,000,000
Success Rate100% (0 failed, 0 timeout)
Duration59 seconds
Avg QPS16,949
Peak QPS22,879
Avg Latency288.5 ms
P50276.5 ms
P95396.5 ms
P99565.8 ms
Max Latency923.1 ms

Latency Distribution

  • P95 / P50 = 1.43x — compact distribution
  • P99 / P50 = 2.05x — no severe tail latency
  • Max / P99 = 1.63x — no extreme outliers

Throughput Timeline

sec | ops/s  | total     | success   | failed | timeout
  1 | 19157  |    19157  |    19157  |      0 |       0
  2 | 18519  |    37676  |    37676  |      0 |       0
  3 | 20657  |    58333  |    58333  |      0 |       0
  4 | 22879  |    81212  |    81212  |      0 |       0
  5 | 10047  |    91259  |    91259  |      0 |       0
  6 | 14954  |   106213  |   106213  |      0 |       0
  7 |  5296  |   111509  |   111509  |      0 |       0
  8 | 14414  |   125923  |   125923  |      0 |       0
  9 | 14895  |   140818  |   140818  |      0 |       0
 10 | 19355  |   160173  |   160173  |      0 |       0
 11 | 14659  |   174832  |   174832  |      0 |       0
 12 | 19602  |   194434  |   194434  |      0 |       0
 13 | 19761  |   214195  |   214195  |      0 |       0
 14 | 19482  |   233677  |   233677  |      0 |       0
 15 | 19802  |   253479  |   253479  |      0 |       0
 16 | 19832  |   273311  |   273311  |      0 |       0
 17 | 19573  |   292884  |   292884  |      0 |       0
 18 | 19678  |   312562  |   312562  |      0 |       0
 19 | 19729  |   332291  |   332291  |      0 |       0
 20 | 20098  |   352389  |   352389  |      0 |       0
 21 | 19679  |   372068  |   372068  |      0 |       0
 22 | 19668  |   391736  |   391736  |      0 |       0
 23 | 20019  |   411755  |   411755  |      0 |       0
 24 | 20032  |   431787  |   431787  |      0 |       0
 25 | 14735  |   446522  |   446522  |      0 |       0
 26 | 19887  |   466409  |   466409  |      0 |       0
 27 | 20070  |   486479  |   486479  |      0 |       0
 28 | 19740  |   506219  |   506219  |      0 |       0
 29 | 19685  |   525904  |   525904  |      0 |       0
 30 | 16554  |   542458  |   542458  |      0 |       0
 31 | 18112  |   560570  |   560570  |      0 |       0
 32 | 19745  |   580315  |   580315  |      0 |       0
 33 | 15044  |   595359  |   595359  |      0 |       0
 34 | 19833  |   615192  |   615192  |      0 |       0
 35 | 15224  |   630416  |   630416  |      0 |       0
 36 | 20189  |   650605  |   650605  |      0 |       0
 37 |  9735  |   660340  |   660340  |      0 |       0
 38 | 14566  |   674906  |   674906  |      0 |       0
 39 | 15277  |   690183  |   690183  |      0 |       0
 40 | 10731  |   700914  |   700914  |      0 |       0
 41 | 18800  |   719714  |   719714  |      0 |       0
 42 | 14732  |   734446  |   734446  |      0 |       0
 43 | 19721  |   754167  |   754167  |      0 |       0
 44 | 14581  |   768748  |   768748  |      0 |       0
 45 | 15069  |   783817  |   783817  |      0 |       0
 46 | 14746  |   798563  |   798563  |      0 |       0
 47 | 18174  |   816737  |   816737  |      0 |       0
 48 | 16045  |   832782  |   832782  |      0 |       0
 49 | 14892  |   847674  |   847674  |      0 |       0
 50 | 15022  |   862696  |   862696  |      0 |       0
 51 | 14609  |   877305  |   877305  |      0 |       0
 52 | 14695  |   892000  |   892000  |      0 |       0
 53 | 19546  |   911546  |   911546  |      0 |       0
 54 | 15179  |   926725  |   926725  |      0 |       0
 55 |  9668  |   936393  |   936393  |      0 |       0
 56 | 14922  |   951315  |   951315  |      0 |       0
 57 | 14696  |   966011  |   966011  |      0 |       0
 58 | 19623  |   985634  |   985634  |      0 |       0
 59 | 14366  | 1000000   | 1000000  |      0 |       0

Analysis

The timeline shows clear periodic fluctuations:

  • Peak: 19k-22k ops/s (sec 1-4, 10, 12-24, 26-29, 32, 34, 36, 43, 53, 58)
  • Trough: 5k-10k ops/s (sec 5, 7, 37, 40, 55)
  • Mid-range: 14k-16k ops/s (remaining seconds)

This sawtooth pattern is caused by Raft log persistence + RocksDB compaction. When RocksDB runs background compaction, it briefly contends for disk I/O, slowing Raft apply and dropping QPS to 5k-10k. Once compaction finishes, QPS recovers to 19k+.

With 5000 concurrency and 288ms average latency, theoretical throughput ceiling = 5000 / 0.288 ≈ 17,361 ops/s, closely matching the actual 16,949. This indicates concurrency is the limiting factor, not the server.

Note: This was built in debug mode (cargo run). Release mode typically improves performance by 2-5x.

1.2 Single-Node Raft Read (placement-list-session)

Environment

Same as 1.1 (run immediately after the write benchmark, with 1M sessions already in RocksDB).

Command

bash
cargo run --package cmd --bin cli-bench meta placement-list-session \
  --host 127.0.0.1 \
  --port 1228 \
  --count 1000000 \
  --concurrency 5000 \
  --timeout-ms 3000 \
  --output table

The bench automatically creates 1 session during setup, then issues 1M ListSession requests against the same client_id.

Key Metrics

MetricValue
Total Requests1,000,000
Success Rate100% (0 failed, 0 timeout)
Records Returned1,000,000 (1 per request)
Duration11 seconds
Avg QPS90,909
Peak QPS102,714
Avg Latency45.6 ms
P5043.0 ms
P9582.3 ms
P99102.3 ms
Max Latency198.7 ms

Latency Distribution

  • P95 / P50 = 1.91x — healthy distribution
  • P99 / P50 = 2.38x — no severe tail latency
  • Max / P99 = 1.94x — no extreme outliers

Throughput Timeline

sec | ops/s   | total     | success   | failed | timeout | received
  1 |  92529  |    92529  |    92529  |      0 |       0 |    92529
  2 | 100804  |   193333  |   193333  |      0 |       0 |   193333
  3 | 102714  |   296047  |   296047  |      0 |       0 |   296047
  4 |  95409  |   391456  |   391456  |      0 |       0 |   391456
  5 |  92831  |   484287  |   484287  |      0 |       0 |   484287
  6 |  89426  |   573713  |   573713  |      0 |       0 |   573713
  7 |  93254  |   666967  |   666967  |      0 |       0 |   666967
  8 |  90311  |   757278  |   757278  |      0 |       0 |   757278
  9 |  93433  |   850711  |   850711  |      0 |       0 |   850711
 10 |  99942  |   950653  |   950653  |      0 |       0 |   950653
 11 |  49347  |  1000000  |  1000000  |      0 |       0 |  1000000

Analysis

Read throughput is remarkably stable, sustaining 89k-103k ops/s throughout, without the sawtooth fluctuations seen in the write benchmark. This is because:

  • Reads bypass Raft consensus: ListSession reads directly from RocksDB, with no log replication or majority confirmation.
  • No WAL write overhead: Read operations do not trigger RocksDB Write-Ahead Log writes and are unaffected by compaction.
  • Significantly lower latency: Average 45.6ms vs 288.5ms for writes — read latency is only 1/6 of write latency.

Read vs Write Comparison

MetricWrite (create-session)Read (list-session)Read/Write Ratio
Avg QPS16,94990,9095.4x
Peak QPS22,879102,7144.5x
Avg Latency288.5 ms45.6 ms6.3x faster
P99 Latency565.8 ms102.3 ms5.5x faster
Throughput StabilityVolatile (5k-22k)Stable (89k-103k)

Note: This was built in debug mode (cargo run). Release mode typically improves performance by 2-5x.


2. MQTT Broker

To be added.