deniz.in

Markets

Weather

Loading weather

· via dev.to (home feed)

RocketMQ-Rust benchmark shows 1.79x synchronous send throughput over Apache RocketMQ 5.5.0

November 2026 benchmark results show RocketMQ-Rust handling 1.79x Apache RocketMQ 5.5.0's synchronous send throughput with far less CPU, but the gap narrows or reverses under some async workloads.

RocketMQ-Rust benchmark shows 1.79x synchronous send throughput over Apache RocketMQ 5.5.0

The headline numbers

A November 2026 benchmark of RocketMQ-Rust reports roughly 1.79 times the synchronous send throughput of Apache RocketMQ 5.5.0 — about 4,000 messages per second for the Rust broker versus about 2,300 for the Java broker. According to the dev.to write-up, which was assembled from the project's public benchmark notes and pull requests (no new benchmark was run for the article), the advantage shrinks or even reverses depending on how the producer sends messages.

Under synchronous send with one request outstanding, the Rust broker's edge came with much lower CPU cost: 137 microseconds of broker CPU per message, versus 381 for the Java broker.

The asynchronous picture is mixed. With 256 in-flight requests sharing a single connection, Rust actually trailed Java slightly — 112,400 versus 116,600 msg/s, or 0.96 times. But with the same concurrency spread across more connections, Rust led by 1.19 times at 4 connections with 64 in flight each, and 1.23 times at 16 connections with 16 each. LitePull consumption throughput favored Rust by 1.30 times, at 140,000 versus 107,700 msg/s. All of these runs used 1 KiB messages with one replica and asynchronous disk flush.

Check whether the client is the bottleneck

When the project repeated the comparison using the Java 5.5.0 client, Rust still held a 1.47 times synchronous advantage, but the asynchronous runs maxed out the Java client rather than the broker. The lesson the benchmark notes draw: verify the client can actually drive the broker before attributing a throughput plateau to the server.

Durability changes the picture

Switching to synchronous flush erased most of the gap. At four connections, Rust managed 47,900 msg/s versus Java's 46,200, and the single-connection Rust run fell slightly behind. Both brokers were waiting on msync calls that took about 2 milliseconds each on this setup. Under a three-replica configuration requiring two in-sync replicas with asynchronous flush, Rust delivered 1.20 to 1.43 times the Java throughput — though the project cautions that all three brokers and the controllers shared the same CPU allocation, so that result reflects the local layout rather than replication capacity across independent hosts.

A tail-latency fix the medians missed

A separate Rust-only before-and-after experiment uncovered a Proxy issue: a custom listener handed to Tonic left Nagle's algorithm enabled on accepted TCP sockets, so small HTTP/2 frames could stall waiting for acknowledgments. Setting TCP_NODELAY on accepted sockets covered both plain and TLS entry points.

The effect showed up almost entirely at the tail. With one 1 KiB message per RPC at 32 connections and 4 requests in flight, the median of run-level p99 latencies fell from 43.6 ms to 6.9 ms, while throughput rose from 40,600 to 42,600 msg/s. At 1 connection with 256 in flight, p99 dropped from 46.4 to 14.0 ms. Median p50 did not change — throughput and median latency alone would have hidden the problem entirely.

A further PGO experiment cut Proxy CPU per message by roughly 10 percent at 1 connection by 256 in flight, but pushed p99 from around 14 ms to around 20 ms, a trade-off the project says belongs in any release decision. The write-up also published Rust and Java Proxy throughput figures, but those runs were collected on different days and are not a paired comparison.

How it was run

Everything ran on a single Intel i7-11700K host under Docker Desktop with a WSL 2 Linux VM (kernel 6.18, 16 GB RAM). Services shared eight logical CPUs while the load generator used the other eight; traffic stayed on loopback and the store used the container filesystem rather than tmpfs. The Rust broker ran its release image with PGO and BOLT; the Java broker used the official Apache RocketMQ 5.5.0 image with default OpenJDK 8 settings. Run order was rotated after warm-up, results are medians of four to nine runs per cell, and no send failures were reported.

The project points teams to its client-production-benchmark and grpc_send_benchmark tools to reproduce the results, and recommends recording the commit or image digest, build flags, message size, connection counts, in-flight requests, replication and flush settings, plus per-run latency percentiles. Long steady-state runs, cold reads, failover and Proxy consumption remain outside the published comparison.

Why it matters

Broker choice usually comes down to throughput, latency and resource cost, and this benchmark offers concrete numbers on all three — with unusually honest caveats. The 1.79x synchronous figure will draw attention, but the more useful finding for teams is how workload-dependent it is: synchronous send and fan-out consumption favor the Rust implementation clearly, while synchronous flush levels the field because both brokers end up waiting on the disk. The TCP_NODELAY episode is a lesson in itself — medians looked healthy while p99 latency was several times worse than it needed to be. Anyone comparing brokers should treat a single loopback host with default JVM settings as a starting point, and reproduce on hardware and workloads that match their own before committing.

  • #rust
  • #apache-rocketmq
  • #message-brokers
  • #benchmarks
  • #performance