RocketMQ Rust 简体中文

Alibaba Cloud ECS

RocketMQ Rust vs. Apache RocketMQ 5.5.0

The gRPC Proxy saw the largest throughput gain. Synchronous sends and LitePull reads also favored Rust. Java led in three high-concurrency Broker workloads.

23 / 26

workloads where Rust matched or exceeded Java throughput in the final retest.

Throughput and latency

With 32 gRPC connections and four requests in flight per connection, the Rust Proxy delivered 2.20× the throughput of the Java Proxy and used 62% less Proxy CPU time per message. Both Proxies sent to the same Rust Broker.

Final-round throughput and CPU cost by workload
WorkloadRust / Java
throughput
Rust CPU time per message
gRPC Proxy, synchronous / 1 × 2561.27× / 1.05×79% / 34% lower
gRPC Proxy, 4 × 64 / 32 × 41.46× / 2.20×39% / 62% lower
Single Broker, synchronous sends1.46–1.72×70–88% lower across 128 B to 64 KiB
Single Broker, LitePull consumption1.34–1.43×41–51% lower
Single Broker, multi-connection async sends (128 B to 4 KiB)1.14–1.23×Similar in most cases, up to 10% lower
SYNC_FLUSH, synchronous / async 4 × 641.32× / 1.22×43% / 16% lower
Three replicas, synchronous sends1.31×32% lower across all three Brokers combined

The Rust Proxy recorded lower p50, p99 and p99.9 latency in every tested configuration. With one connection and 256 requests in flight, p99 was 6.47 ms for Rust and 8.21 ms for Java. At p99.9 the gap widened to 7.71 ms versus 27.2 ms. Synchronous sends and LitePull reads also had lower p99 latency on the single Rust Broker.

gRPC Proxy tail latency 99th and 99.9th percentile send latencies in milliseconds. Both Proxies used the same Rust Broker.
Proxy 1 × 256 p99 — Rust 6.47 ms, Java 8.21 ms. Proxy 1 × 256 p99.9 — Rust 7.71 ms, Java 27.2 ms. Proxy 4 × 64 p99 — Rust 5.19 ms, Java 10.1 ms. Proxy 4 × 64 p99.9 — Rust 7.19 ms, Java 28.0 ms. Proxy 32 × 4 p99 — Rust 2.85 ms, Java 7.94 ms. Proxy 32 × 4 p99.9 — Rust 4.91 ms, Java 25.6 ms. RustJava 5.5.0 0 ms 8 ms 16 ms 24 ms 32 ms 40 ms Proxy 1 × 256 p99 — Rust 6.47 ms, Java 8.21 ms.6.478.21 Proxy 1 × 256 p99 Proxy 1 × 256 p99.9 — Rust 7.71 ms, Java 27.2 ms.7.7127.2 Proxy 1 × 256 p99.9 Proxy 4 × 64 p99 — Rust 5.19 ms, Java 10.1 ms.5.1910.1 Proxy 4 × 64 p99 Proxy 4 × 64 p99.9 — Rust 7.19 ms, Java 28.0 ms.7.1928.0 Proxy 4 × 64 p99.9 Proxy 32 × 4 p99 — Rust 2.85 ms, Java 7.94 ms.2.857.94 Proxy 32 × 4 p99 Proxy 32 × 4 p99.9 — Rust 4.91 ms, Java 25.6 ms.4.9125.6 Proxy 32 × 4 p99.9
Compare throughput for all 26 workloads
Throughput across all 26 workloads Percentage difference from Java in the final round. The vertical line at zero marks equal throughput.
Proxy · 32 × 4 — Rust throughput was 2.20× Java throughput. Proxy · 4 × 64 — Rust throughput was 1.46× Java throughput. Proxy · Sync — Rust throughput was 1.27× Java throughput. Proxy · 1 × 256 — Rust throughput was 1.05× Java throughput. Single-replica Broker · 1 KiB Sync — Rust throughput was 1.72× Java throughput. Single-replica Broker · 128 B Sync — Rust throughput was 1.69× Java throughput. Single-replica Broker · 4 KiB Sync — Rust throughput was 1.65× Java throughput. Single-replica Broker · 64 KiB Sync — Rust throughput was 1.46× Java throughput. Single-replica Broker · 64 KiB LitePull — Rust throughput was 1.43× Java throughput. Single-replica Broker · 1 KiB LitePull — Rust throughput was 1.38× Java throughput. Single-replica Broker · 128 B LitePull — Rust throughput was 1.36× Java throughput. Single-replica Broker · 4 KiB LitePull — Rust throughput was 1.34× Java throughput. Single-replica Broker · SYNC_FLUSH Sync — Rust throughput was 1.32× Java throughput. Single-replica Broker · 1 KiB Async 4 × 64 — Rust throughput was 1.23× Java throughput. Single-replica Broker · Java producer · 1 thread — Rust throughput was 1.23× Java throughput. Single-replica Broker · SYNC_FLUSH Async 4 × 64 — Rust throughput was 1.22× Java throughput. Single-replica Broker · 1 KiB Async 16 × 16 — Rust throughput was 1.17× Java throughput. Single-replica Broker · 128 B Async 4 × 64 — Rust throughput was 1.17× Java throughput. Single-replica Broker · 4 KiB Async 4 × 64 — Rust throughput was 1.14× Java throughput. Single-replica Broker · SYNC_FLUSH Async 1 × 256 — Rust throughput was 1.04× Java throughput. Single-replica Broker · 1 KiB Async 1 × 256 — Rust throughput was 1.03× Java throughput. Single-replica Broker · 64 KiB Async 4 × 64 — Rust throughput was 1.01× Java throughput. Single-replica Broker · Java producer · 256 threads — Rust throughput was 0.92× Java throughput. Three-replica Broker · Sync — Rust throughput was 1.31× Java throughput. Three-replica Broker · Async 4 × 64 — Rust throughput was 0.94× Java throughput. Three-replica Broker · Async 1 × 256 — Rust throughput was 0.93× Java throughput. Higher Rust throughputLower Rust throughput -20% 0% (parity) +25% +50% +75% +100% +125% Proxy Proxy · 32 × 4 — Rust throughput was 2.20× Java throughput. 32 × 4 +120% Proxy · 4 × 64 — Rust throughput was 1.46× Java throughput. 4 × 64 +46% Proxy · Sync — Rust throughput was 1.27× Java throughput. Sync +27% Proxy · 1 × 256 — Rust throughput was 1.05× Java throughput. 1 × 256 +5% Single-replica Broker Single-replica Broker · 1 KiB Sync — Rust throughput was 1.72× Java throughput. 1 KiB Sync +72% Single-replica Broker · 128 B Sync — Rust throughput was 1.69× Java throughput. 128 B Sync +69% Single-replica Broker · 4 KiB Sync — Rust throughput was 1.65× Java throughput. 4 KiB Sync +65% Single-replica Broker · 64 KiB Sync — Rust throughput was 1.46× Java throughput. 64 KiB Sync +46% Single-replica Broker · 64 KiB LitePull — Rust throughput was 1.43× Java throughput. 64 KiB LitePull +43% Single-replica Broker · 1 KiB LitePull — Rust throughput was 1.38× Java throughput. 1 KiB LitePull +38% Single-replica Broker · 128 B LitePull — Rust throughput was 1.36× Java throughput. 128 B LitePull +36% Single-replica Broker · 4 KiB LitePull — Rust throughput was 1.34× Java throughput. 4 KiB LitePull +34% Single-replica Broker · SYNC_FLUSH Sync — Rust throughput was 1.32× Java throughput. SYNC_FLUSH Sync +32% Single-replica Broker · 1 KiB Async 4 × 64 — Rust throughput was 1.23× Java throughput. 1 KiB Async 4 × 64 +23% Single-replica Broker · Java producer · 1 thread — Rust throughput was 1.23× Java throughput. Java producer · 1 thread +23% Single-replica Broker · SYNC_FLUSH Async 4 × 64 — Rust throughput was 1.22× Java throughput. SYNC_FLUSH Async 4 × 64 +22% Single-replica Broker · 1 KiB Async 16 × 16 — Rust throughput was 1.17× Java throughput. 1 KiB Async 16 × 16 +17% Single-replica Broker · 128 B Async 4 × 64 — Rust throughput was 1.17× Java throughput. 128 B Async 4 × 64 +17% Single-replica Broker · 4 KiB Async 4 × 64 — Rust throughput was 1.14× Java throughput. 4 KiB Async 4 × 64 +14% Single-replica Broker · SYNC_FLUSH Async 1 × 256 — Rust throughput was 1.04× Java throughput. SYNC_FLUSH Async 1 × 256 +4% Single-replica Broker · 1 KiB Async 1 × 256 — Rust throughput was 1.03× Java throughput. 1 KiB Async 1 × 256 +3% Single-replica Broker · 64 KiB Async 4 × 64 — Rust throughput was 1.01× Java throughput. 64 KiB Async 4 × 64 +1% Single-replica Broker · Java producer · 256 threads — Rust throughput was 0.92× Java throughput. Java producer · 256 threads −8% Three-replica Broker Three-replica Broker · Sync — Rust throughput was 1.31× Java throughput. Sync +31% Three-replica Broker · Async 4 × 64 — Rust throughput was 0.94× Java throughput. Async 4 × 64 −6% Three-replica Broker · Async 1 × 256 — Rust throughput was 0.93× Java throughput. Async 1 × 256 −7%
Compare throughput gains and CPU savings
Throughput and CPU time per message Selected workloads where Rust delivered higher throughput. Both series use Java as the baseline. The replicated synchronous result combines CPU time on all three Brokers.
Proxy · 32 × 4 — Rust delivered 120% more messages per second and used 62% less CPU time per message. Proxy · 4 × 64 — Rust delivered 46% more messages per second and used 39% less CPU time per message. Proxy · Sync — Rust delivered 27% more messages per second and used 79% less CPU time per message. Proxy · 1 × 256 — Rust delivered 5% more messages per second and used 34% less CPU time per message. Single-replica Broker · 1 KiB Sync — Rust delivered 72% more messages per second and used 70% less CPU time per message. Single-replica Broker · 128 B Sync — Rust delivered 69% more messages per second and used 71% less CPU time per message. Single-replica Broker · 4 KiB Sync — Rust delivered 65% more messages per second and used 73% less CPU time per message. Single-replica Broker · 64 KiB Sync — Rust delivered 46% more messages per second and used 88% less CPU time per message. Single-replica Broker · SYNC_FLUSH Sync — Rust delivered 32% more messages per second and used 43% less CPU time per message. Single-replica Broker · 1 KiB LitePull — Rust delivered 38% more messages per second and used 41% less CPU time per message. Single-replica Broker · 64 KiB LitePull — Rust delivered 43% more messages per second and used 50% less CPU time per message. Single-replica Broker · 1 KiB Async 4 × 64 — Rust delivered 23% more messages per second and used 10% less CPU time per message. Single-replica Broker · SYNC_FLUSH Async 4 × 64 — Rust delivered 22% more messages per second and used 16% less CPU time per message. Single-replica Broker · 1 KiB Async 16 × 16 — Rust delivered 17% more messages per second and used 7% less CPU time per message. Three-replica Broker · Sync send (cluster CPU) — Rust delivered 31% more messages per second and used 32% less CPU time per message. Rust throughput gainRust CPU time saved per message 0% 25% 50% 75% 100% 125% Proxy Proxy · 32 × 4 — Rust delivered 120% more messages per second and used 62% less CPU time per message.+120%−62% 32 × 4 Proxy · 4 × 64 — Rust delivered 46% more messages per second and used 39% less CPU time per message.+46%−39% 4 × 64 Proxy · Sync — Rust delivered 27% more messages per second and used 79% less CPU time per message.+27%−79% Sync Proxy · 1 × 256 — Rust delivered 5% more messages per second and used 34% less CPU time per message.+5%−34% 1 × 256 Single-replica Broker Single-replica Broker · 1 KiB Sync — Rust delivered 72% more messages per second and used 70% less CPU time per message.+72%−70% 1 KiB Sync Single-replica Broker · 128 B Sync — Rust delivered 69% more messages per second and used 71% less CPU time per message.+69%−71% 128 B Sync Single-replica Broker · 4 KiB Sync — Rust delivered 65% more messages per second and used 73% less CPU time per message.+65%−73% 4 KiB Sync Single-replica Broker · 64 KiB Sync — Rust delivered 46% more messages per second and used 88% less CPU time per message.+46%−88% 64 KiB Sync Single-replica Broker · SYNC_FLUSH Sync — Rust delivered 32% more messages per second and used 43% less CPU time per message.+32%−43% SYNC_FLUSH Sync Single-replica Broker · 1 KiB LitePull — Rust delivered 38% more messages per second and used 41% less CPU time per message.+38%−41% 1 KiB LitePull Single-replica Broker · 64 KiB LitePull — Rust delivered 43% more messages per second and used 50% less CPU time per message.+43%−50% 64 KiB LitePull Single-replica Broker · 1 KiB Async 4 × 64 — Rust delivered 23% more messages per second and used 10% less CPU time per message.+23%−10% 1 KiB Async 4 × 64 Single-replica Broker · SYNC_FLUSH Async 4 × 64 — Rust delivered 22% more messages per second and used 16% less CPU time per message.+22%−16% SYNC_FLUSH Async 4 × 64 Single-replica Broker · 1 KiB Async 16 × 16 — Rust delivered 17% more messages per second and used 7% less CPU time per message.+17%−7% 1 KiB Async 16 × 16 Three-replica Broker Three-replica Broker · Sync send (cluster CPU) — Rust delivered 31% more messages per second and used 32% less CPU time per message.+31%−32% Sync send (cluster CPU)
Compare single-Broker p99 latency
Single-replica Broker p99 latency 99th percentile latency in milliseconds for synchronous sends and LitePull consumption.
1 KiB Sync p99 — Rust 0.20 ms, Java 0.36 ms. 64 KiB Sync p99 — Rust 0.38 ms, Java 0.67 ms. 1 KiB LitePull p99 — Rust 0.26 ms, Java 0.36 ms. RustJava 5.5.0 0 ms 0.16 ms 0.32 ms 0.48 ms 0.64 ms 0.8 ms 1 KiB Sync p99 — Rust 0.20 ms, Java 0.36 ms.0.200.36 1 KiB Sync p99 64 KiB Sync p99 — Rust 0.38 ms, Java 0.67 ms.0.380.67 64 KiB Sync p99 1 KiB LitePull p99 — Rust 0.26 ms, Java 0.36 ms.0.260.36 1 KiB LitePull p99

Where Java led

Rust delivered 6–8% less throughput in three workloads. Each used more Broker CPU time per message. The Java producer used one connection with 256 synchronous sender threads. The replicated workloads used asynchronous requests.

All three workloads below Java throughput
WorkloadRust / Java
throughput
CPU per message
Rust / Java
Single Broker, Java producer, 256 threads0.92×66 / 49 µs
Three replicas, async 1 × 2560.93×101 / 86 µs on leader
Three replicas, async 4 × 640.94×101 / 91 µs on leader

In both replicated async workloads, the Rust leader executed about 25% fewer user-mode instructions per message but spent roughly twice as many cycles. Cross-core handoffs, wakeups and shared counters are candidates for investigation. Some multi-connection Broker sends also had p99 latencies about 1–2 ms higher on Rust.

Inspect the three-replica leader’s CPU counters
CPU counters on the three-replica leader Thousands of user-mode cycles and instructions per message during asynchronous sends.
Async 1 × 256 · user-mode cycles — Rust 235k, Java 125k. Async 4 × 64 · user-mode cycles — Rust 242k, Java 118k. Async 1 × 256 · user-mode instructions — Rust 104k, Java 140k. Async 4 × 64 · user-mode instructions — Rust 105k, Java 139k. RustJava 5.5.0 0k 60k 120k 180k 240k 300k Async 1 × 256 · user-mode cycles — Rust 235k, Java 125k.235k125k Async 1 × 256 · user-mode cycles Async 4 × 64 · user-mode cycles — Rust 242k, Java 118k.242k118k Async 4 × 64 · user-mode cycles Async 1 × 256 · user-mode instructions — Rust 104k, Java 140k.104k140k Async 1 × 256 · user-mode instructions Async 4 × 64 · user-mode instructions — Rust 105k, Java 139k.105k139k Async 4 × 64 · user-mode instructions

Test machines and conditions

All hosts ran Ubuntu 24.04 (Linux 6.8) on Intel Xeon 6982P-C processors in the same Alibaba Cloud VPC in Beijing.

Alibaba Cloud ECS machines (resources per host)
HostECS instance typevCPUsReported RAMRole
Lecs.hfc9i.4xlarge1630 GiBLoad generator and NameServer. Also ran all three Controller processes in the replication tests.
B, B2, B3ecs.i5.2xlarge861 GiBOne Broker per host, with the message store on local NVMe. The single-Broker test recorded a 1,788 GiB ext4 volume mounted at /data.
Pecs.hfc9i.2xlarge814 GiBDedicated gRPC Proxy host for the Rust and Java Proxy runs.

The single-Broker tests used two machines (L and B). Proxy tests used three (L, P and B). Three-replica tests used four (L, B, B2 and B3).

Three rounds ran on Alibaba Cloud ECS from November 26 to 28, 2026. The final round compared a release-image build of RocketMQ Rust from main with Apache RocketMQ 5.5.0 (Java). Rust and Java alternated on the same instances within each round. Reported values are means of two to four measurements per scenario. Each round used fresh instances. Tested commit 8bed52240

In the final round P ran in another availability zone. The round-trip time from L to P was about 0.41 ms, compared with 0.13 ms within one zone. The 64 KiB asynchronous workload reached the network bandwidth limit.

All 26 normal workloads recorded zero failures in the final retest. In a separate quorum-loss check, both implementations rejected writes after both followers stopped.

How to read the workloads
Connections × requests in flight
4 × 64 means four connections with up to 64 outstanding requests each. A synchronous sender waits for one response before sending the next message. The Java-producer tests specify threads per connection separately.
Payload and storage
The default payload is 1 KiB. LitePull measures consumption of previously stored messages. The default ASYNC_FLUSH allows an acknowledgment after the write reaches the page cache. SYNC_FLUSH waits for the disk flush.
Broker topology
The single-replica configuration uses one Broker. In Controller mode, the three-replica group requires the leader and at least one follower to acknowledge each write. Both gRPC Proxies forward to the same Rust Broker over Remoting.

Deployment implications

The measured gains were largest for deployments dominated by Proxy traffic, synchronous sends or LitePull consumption. For high-concurrency asynchronous Broker traffic, size the CPU budget using the client and replication pattern you actually run. The three slower cases used roughly 10–35% more Broker CPU time per message on these instances.

The next performance target is to reduce per-request handoffs and shared atomic operations. Repeating the 256-thread Java-client workload on the same instances would help separate runtime variation from instance variation. Longer soak tests and failover tests would provide evidence beyond the short benchmark runs.