Which RPC Framework Wins? Benchmarking Dubbo, Motan, rpcx, gRPC, and Thrift
This article benchmarks five popular RPC frameworks—Dubbo, Motan, rpcx, gRPC, and Thrift—by measuring throughput, average latency, median latency, and maximum latency under varying client concurrency levels, revealing rpcx as the fastest and gRPC as the most consistent performer.
Dubbo is an open‑source high‑performance Java RPC framework from Alibaba that integrates seamlessly with Spring, but its development team has been disbanded internally; Motan, rpcx, gRPC, and Thrift are alternative RPC solutions with different language ecosystems.
The benchmark uses a unified service that exchanges a BenchmarkMessage defined in Protocol Buffers; the protobuf file (≈581 bytes when serialized) is shown below.
syntax = "proto2";
package main;
option optimize_for = SPEED;
message BenchmarkMessage {
required string field1 = 1;
optional string field9 = 9;
optional string field18 = 18;
optional bool field80 = 80 [default = false];
optional bool field81 = 81 [default = true];
required int32 field2 = 2;
required int32 field3 = 3;
optional int32 field280 = 280;
optional int32 field6 = 6 [default = 0];
optional int64 field22 = 22;
optional string field4 = 4;
repeated fixed64 field5 = 5;
optional bool field59 = 59 [default = false];
optional string field7 = 7;
optional int32 field16 = 16;
optional int32 field17 = 17;
optional bool field13 = 13 [default = true];
optional bool field14 = 14 [default = true];
optional int32 field104 = 104 [default = 0];
optional int32 field100 = 100 [default = 0];
optional int32 field101 = 101 [default = 0];
optional string field102 = 102;
optional string field103 = 103;
optional int32 field29 = 29 [default = 0];
optional bool field30 = 30 [default = false];
optional int32 field60 = 60;
optional int32 field271 = 271;
optional int32 field272 = 272;
optional int32 field150 = 150;
optional int32 field23 = 23 [default = 0];
optional bool field24 = 24 [default = false];
optional int32 field25 = 25 [default = 0];
optional int32 field78 = 78;
optional int32 field67 = 67 [default = 0];
optional int32 field68 = 68;
optional int32 field128 = 128 [default = 0];
optional string field129 = 129 [default = "xxxxxxxxxxxxxxxxxxxxx"];
optional int32 field131 = 131 [default = 0];
}
service Greeter {
rpc Say (BenchmarkMessage) returns (BenchmarkMessage) {}
}The equivalent Thrift definition (used for the Java test) is shown below.
namespace java com.colobu.thrift
struct BenchmarkMessage {
1: string field1,
2: i32 field2,
3: i32 field3,
4: string field4,
5: i64 field5,
6: i32 field6,
7: string field7,
9: string field9,
12: bool field12,
13: bool field13,
14: bool field14,
16: i32 field16,
17: bool field17,
18: string field18,
22: i64 field22,
23: i32 field23,
24: bool field24,
25: i32 field25,
29: i32 field29,
30: bool field30,
59: bool field59,
60: i32 field60,
67: i32 field67,
68: i32 field68,
78: bool field78,
80: bool field80,
81: bool field81,
100: i32 field100,
101: i32 field101,
102: string field102,
103: string field103,
104: i32 field104,
128: i32 field128,
129: string field129,
130: i32 field130,
131: i32 field131,
150: i32 field150,
271: i32 field271,
272: i32 field272,
280: i32 field280
}
service Greeter {
BenchmarkMessage say(1: BenchmarkMessage name)
}The service simply receives a BenchmarkMessage, modifies the first two fields to "OK" and 100, and returns it so the client can verify correct execution.
Test code for Dubbo, Motan, rpcx, and gRPC is taken from their respective official repositories; Thrift is tested with Java.
Benchmark environment: two identical machines (one server, one client) with Intel Xeon E5‑2620 v2 (24 cores), 16 GB RAM, CentOS 6.4, Go 1.7, Java 1.8, Dubbo 2.5.4‑SNAPSHOT, Motan 0.2.2‑SNAPSHOT, gRPC 1.0.0, rpcx 2016‑09‑05, Thrift 0.9.3 (Java).
Client concurrency levels: 100, 500, 1000, 2000, 5000.
Metrics recorded: throughput (calls per second), average latency, median latency, maximum latency, and 100 % success rate.
Results:
Throughput under increasing concurrency shows rpcx leading, followed by Thrift, while gRPC, Dubbo, and Motan drop noticeably at high concurrency.
Average latency mirrors throughput: rpcx stays below 30 ms, Dubbo’s latency spikes with many clients.
Median latency highlights gRPC as the most consistent performer.
Maximum latency (worst‑case) shows rpcx staying under 1 s, Motan under 2 s, while the others exhibit longer tails.
In summary, the benchmark demonstrates that rpcx delivers the highest throughput and lowest latency across all tested concurrency levels, gRPC provides the most stable latency distribution, and Dubbo and Motan suffer significant performance degradation under heavy client load.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Backend Technology
Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
