Skip to main content

Performance benchmark: RocketMQ Rust and Java 5.5.0

This page reports how RocketMQ Rust compares with Apache RocketMQ 5.5.0 under the same workloads on the same machine. All figures were measured in November 2026 on one host, with the services and the load generator pinned to separate CPUs. They show relative cost and throughput for the listed workloads, not the capacity of a production deployment; for sizing, see capacity and performance.

Summary​

AreaResult
Broker, synchronous sends (1 KiB)1.79× Java's throughput, 64% less Broker CPU per message
Broker, asynchronous sends (1 KiB)1.19× with 4 connections, 1.23× with 16; 0.96× with a single connection
Broker, LitePull consumption1.30× Java's throughput, 37% less Broker CPU per message
Message sizeRust's lead grows with size: 1.34×–2.14× at 64 KiB, at 14%–37% of Java's Broker CPU per message
SYNC_FLUSH1.04× with 4 connections, 0.96× with one; both are bound by msync latency
Three replicas (Controller mode)1.20×–1.43×, at 70%–79% of Java's Broker CPU per message
Proxy, gRPC sends1.1×–3.6× the Java Proxy's throughput in the measured loads (not measured back to back, see below)

The one load where Rust is still below Java is asynchronous sending over a single connection with many requests in flight (0.96×).

Test setup​

ItemSetting
HostIntel Core i7-11700K (8 cores, 16 threads), Docker Desktop on Windows with a WSL 2 Linux VM (kernel 6.18, 16 GB memory)
CPU placementNameServer, Broker and Proxy on logical CPUs 0–7 (4 physical cores with hyper-threading); the load generator on CPUs 8–15
Network and storageLoopback; the store on the container's file system, not on tmpfs
RocketMQ RustBuilt as the release images build it (docker/Dockerfile.base): release features, the Broker with profile-guided optimization (PGO) and BOLT, the Proxy with PGO
RocketMQ JavaThe apache/rocketmq:5.5.0 image with its default start scripts and JVM settings (OpenJDK 8)
Broker defaultsOne replica, ASYNC_FLUSH, 1 KiB messages, unless a section says otherwise
Load generatorThe same Rust client for both Brokers: the client-production-benchmark example of rocketmq-client. For the Proxy, the grpc_send_benchmark example of rocketmq-proxy
ProcedureA fresh Broker or Java container per scenario, a warm-up run, then measured runs; the variants rotate their order across rounds, and medians of 4 to 9 runs per cell are reported. Every reported run had zero failed sends

In-flight limits: a synchronous send keeps one request outstanding; "1 connection" keeps 256 asynchronous sends outstanding on one connection, "4 connections" 64 on each, and "16 connections" 16 on each. Broker CPU per message is the Broker process's CPU time divided by the messages sent, from /proc and perf stat.

Broker: sending and consuming 1 KiB messages​

LoadJava 5.5.0RustRust ÷ JavaBroker CPU per message, Java → Rust
Synchronous2.3k msg/s, p50 0.43 ms4.0k msg/s, p50 0.24 ms1.79381 → 137 µs
Asynchronous, 1 connection × 256116.6k msg/s112.4k msg/s0.9644.9 → 46.8 µs
Asynchronous, 4 connections × 64115.9k msg/s137.8k msg/s1.1950.5 → 46.4 µs
Asynchronous, 16 connections × 16100.9k msg/s123.7k msg/s1.2358.4 → 51.4 µs
LitePull consumption107.7k msg/s140.0k msg/s1.3017.9 → 11.2 µs

The single-connection throughput is from the round after #12699, which lets a connection's session task read and write without returning to the scheduler queue at every read turn (+13%); its CPU per message is from the round before, and #12699 changed it by 0.4%. The Rust Broker uses fewer instructions per message than the Java Broker in every load; on one busy connection it runs those instructions at a lower rate per cycle, which keeps it just below Java there.

Message size​

Throughput ratio, Rust ÷ Java, single replica (message bodies are not compressed):

Message sizeSynchronous1 connection × 2564 connections × 64Broker CPU per message, Rust ÷ Java
128 B1.741.141.340.39 / 0.88 / 0.85
1 KiB1.720.991.160.39 / 1.05 / 0.95
4 KiB1.861.211.550.21 / 0.59 / 0.54
64 KiB2.141.491.340.14 / 0.29 / 0.37

At 64 KiB with one connection the Rust Broker stored about 1.05 GB/s, the Java Broker about 0.70 GB/s. The 1 KiB row here comes from a separate, noisier round than the table above.

Durability settings​

Synchronous flush. With flushDiskType = SYNC_FLUSH and 1 KiB messages, after #12716:

LoadJava 5.5.0RustRust ÷ Java
Synchronous0.7k msg/s0.8k msg/s1.15
Asynchronous, 1 connection × 25648.1k msg/s46.3k msg/s0.96
Asynchronous, 4 connections × 6446.2k msg/s47.9k msg/s1.04

Both Brokers wait for msync, about 2 ms per call on this disk, and each flush covers a similar number of messages.

Three replicas. One Broker group in Controller mode with three replicas and two required in-sync replicas (totalReplicas = 3, inSyncReplicas = 2, minInSyncReplicas = 2), ASYNC_FLUSH. After each run both slaves were stopped and synchronous sends to the master failed, confirming that the master waits for replication.

LoadJava 5.5.0RustRust ÷ JavaCPU per message, all three Brokers
Synchronous1.3k msg/s1.9k msg/s1.391,062 → 748 µs
Asynchronous, 1 connection × 25644.2k msg/s63.2k msg/s1.43127 → 96 µs
Asynchronous, 4 connections × 6453.7k msg/s64.3k msg/s1.20119 → 94 µs

All three Brokers and the Controllers share the same 8 logical CPUs here, so the asynchronous results show the CPU limit of that layout for both implementations rather than the limit of replication itself.

With the Java client​

To rule out an effect of the Rust client, the same loads were run with a Java 5.5.0 client (a minimal benchmark on the image's rocketmq-client, with the same in-flight limits). With the Java client, the Rust Broker used 59% less CPU per message for synchronous sends, 3.6% more with one asynchronous connection, and 11.5% and 23.2% less with 4 and 16 client processes. Synchronous throughput was 1.47× Java's. In the asynchronous loads the Java client itself became the limit, so both Brokers reached about the same throughput.

Proxy: gRPC sends​

Cluster mode, gRPC on the Proxy, one 1 KiB message per RPC; each connection is a separate client. NameServer, Broker and Proxy share CPUs 0–7. The Rust figures are for the current Proxy, including #12789 (concurrent sends per client), #12798 (TCP_NODELAY on accepted connections) and #12804 (PGO).

LoadJava 5.5.0 ProxyRust ProxyRust Proxy CPU per messageRust p99
Synchronous0.8k–0.9k msg/s2.89k msg/s184 µs0.49 ms
1 connection × 25634.9k–35.4k msg/s38.6k msg/s97 µs20 ms
4 connections × 6439.3k–39.7k msg/s53.1k msg/s82 µs10.5 ms
32 connections × 427.2k–28.4k msg/s45.7k msg/s91 µs6.5 ms

The Java Proxy runs were one day earlier than the Rust Proxy runs, on the same host and settings, and they are not back-to-back pairs. In an earlier back-to-back run with 32 connections × 4, the Java Proxy's p99 was 9.0 ms. Before the fixes above, the Rust Proxy passed 4.7k msg/s with one connection and rejected most sends; the architecture page describes the Proxy's execution model.

Not covered yet​

  • Separate machines and a real network: every result above comes from one host over loopback. A full benchmark on dedicated machines is planned; issue #12799 lists the machines it needs and how to sponsor them.
  • Push and POP consumers, tag and SQL filtering, reads of data no longer in the page cache, many topics and queues, and long-running or failover tests.
  • Consumption through the Proxy: only gRPC sends were measured.

Reproduce a measurement​

Build the services as the release images do (docker/Dockerfile.base; ROCKETMQ_BROKER_PGO, ROCKETMQ_BROKER_BOLT and ROCKETMQ_PROXY_PGO default to true), start a NameServer and a Broker, and pin the load generator to CPUs other than the Broker's. For example, four asynchronous connections are four concurrent client processes like this one:

taskset -c 8-15 cargo run --release -p rocketmq-client-rust --example client-production-benchmark -- \
--namesrv 127.0.0.1:9876 --topic BenchTopic --scenario async \
--message-count 100000 --message-size 1024 --batch-size 32 --inflight 64 --output-json result.json

The scenarios are sync, async and lite-pull. For the Proxy, create the topic through the Broker first, then run:

taskset -c 8-15 cargo run --release -p rocketmq-proxy --example grpc_send_benchmark -- \
--endpoint http://127.0.0.1:8081 --topic BenchTopic --message-count 200000 --warmup-count 100000 \
--connections 4 --inflight 64

Run the Java side with the same message size, in-flight limits and CPU placement, use a fresh Broker per scenario, and compare medians of several rotated runs rather than single results. Follow the workload checklist in capacity and performance.