Repository navigation
Repository tools benchmark README
alanxtl edited this page Sep 20, 2026
·
1 revision
主仓库文档快照;main 的说明不自动适用于所有已发布版本。 来源:原文 · 提交
832124aaacf0· 返回目录
English | 中文
Performance benchmark suite for comparing Dubbo-Go / Dubbo-Java / gRPC frameworks.
- Go: 1.23+
- Java: 8+
- Maven: 3.6+
- protoc: 3.0+
| Framework | Default Port |
|---|---|
| Dubbo-Go | 20000 |
| Dubbo-Java | 20001 |
| gRPC | 50051 |
tools/benchmark
├── client/ # Benchmark client
│ ├── main.go # Entry point
│ ├── clients/ # Client implementations
│ │ ├── dubbo_client.go # Dubbo-Go client
│ │ └── grpc_client.go # gRPC client
│ ├── engine/ # Benchmark engine
│ │ ├── engine.go # Engine logic
│ │ ├── statistics.go # Statistics calculation
│ │ └── metrics.go # Metrics collection
│ ├── monitor/ # System monitor
│ │ └── system_monitor.go # CPU/Memory monitor
│ └── payload/ # Payload generator
│ └── payload.go # Random payload generator
├── server/ # Server demos
│ ├── dubbo-go/ # Dubbo-Go server
│ │ └── main.go
│ ├── dubbo-java/ # Dubbo-Java server
│ │ └── pom.xml
│ └── grpc/ # gRPC server
│ └── main.go
├── proto/ # Protocol definitions and generated code
│ ├── benchmark.proto # Protobuf definition
│ ├── benchmark.pb.go # Generated Go code
│ ├── benchmark_grpc.pb.go # Generated gRPC code
│ └── benchmark.triple.go # Generated Triple code
├── scripts/ # Automation scripts
│ ├── gen_code.sh # Protobuf code generation
│ ├── run_all.sh # Run all benchmarks
│ └── run_single.sh # Run single benchmark
├── config.yaml # Benchmark configuration
├── README.md # English documentation
└── README_CN.md # Chinese documentation
Test configuration is in config.yaml, including:
-
payload_sizes: Payload sizes (in bytes) -
serializations: Serialization protocols -
compressions: Compression strategies -
call_modes: Call modes -
concurrency_levels: Concurrency levels -
benchmark: Benchmark parameters (warmup time, test duration, timeout)
After modifying proto/benchmark.proto, regenerate code:
./scripts/gen_code.shThis script generates:
-
benchmark.pb.go- Protobuf basic code -
benchmark.triple.go- Dubbo Triple protocol code -
benchmark_grpc.pb.go- gRPC protocol code
# Using script
./scripts/run_single.sh dubbo-go 1024 protobuf none 100 unary
# Or run directly
go run client/main.go \
--framework dubbo-go \
--payload 1024 \
--serialization protobuf \
--compression none \
--concurrency 100 \
--mode unary./scripts/run_all.sh| Parameter | Description | Default |
|---|---|---|
--framework |
Test framework | dubbo-go |
--payload |
Payload size (bytes) | 1024 |
--serialization |
Serialization protocol | protobuf |
--compression |
Compression strategy | none |
--concurrency |
Concurrency level | 100 |
--mode |
Call mode | unary |
--duration |
Test duration | 60s |
--warmup |
Warmup duration | 10s |
--addr |
Server address | Auto select |
--pid |
Server PID (for system monitoring) | 0 |
| Parameter | Values |
|---|---|
--framework |
dubbo-go / dubbo-java / grpc |
--serialization |
hessian2 / protobuf / msgpack |
--compression |
none / default / fastest |
--mode |
unary / streaming |
# Dubbo-Go Server
cd server/dubbo-go
go run main.go --serialization protobuf --compression none --port 20000
# gRPC Server
cd server/grpc
go run main.go --port 50051
# Dubbo-Java Server
cd server/dubbo-java
mvn clean package
java -jar target/benchmark-dubbo-java.jar- Go Version: 1.25
- Java Version: 8+
- Test Frameworks: Dubbo-Go / Dubbo-Java / gRPC
- Test Date: 2026-07-27
- Warmup Duration: 10s
- Test Duration: 60s per test case
| Parameter | Value |
|---|---|
| Payload Size | 128B / 1KiB / 16KiB / 1MiB |
| Serialization | protobuf / hessian2 / msgpack |
| Compression | none / default / fastest |
| Concurrency | 50 / 100 / 500 / 1000 / 2000 |
| Call Mode | unary / streaming |
| Concurrency | dubbo-go | dubbo-java | grpc |
|---|---|---|---|
| 50 | 19,732 | 18,560 | 106,648 |
| 100 | 19,231 | 18,120 | 118,044 |
| Concurrency | dubbo-go | dubbo-java | grpc |
|---|---|---|---|
| 50 | 3.30 | 8.21 | 0.94 |
| 100 | 6.37 | 12.50 | 1.61 |
| Concurrency | dubbo-go | dubbo-java | grpc |
|---|---|---|---|
| 50 | 17,563 | 16,830 | 93,172 |
| 100 | 16,075 | 15,240 | 103,253 |
| Concurrency | dubbo-go | dubbo-java | grpc |
|---|---|---|---|
| 50 | 3.64 | 9.15 | 1.07 |
| 100 | 7.27 | 14.80 | 1.72 |
| Concurrency | dubbo-go | dubbo-java | grpc |
|---|---|---|---|
| 50 | 9,461 | 8,720 | 43,339 |
| 100 | 7,944 | 7,350 | 41,723 |
| Concurrency | dubbo-go | dubbo-java | grpc |
|---|---|---|---|
| 50 | 6.89 | 18.30 | 1.99 |
| 100 | 21.32 | 35.60 | 3.67 |
| Concurrency | dubbo-go | dubbo-java | grpc |
|---|---|---|---|
| 50 | 347 | 486 | 1,431 |
| 100 | 310 | 452 | 1,453 |
| Concurrency | dubbo-go | dubbo-java | grpc |
|---|---|---|---|
| 50 | 347.29 | 285.40 | 59.81 |
| 100 | 795.42 | 420.60 | 109.15 |
| Framework | CPU Avg (%) | Memory Peak (MB) |
|---|---|---|
| dubbo-go | 324.0 | 69.7 |
| dubbo-java | 52.8 | 256.3 |
| grpc | 415.7 | 34.3 |
Test results are saved in data/ directory with the naming format:
{framework}_{payload}_{serialization}_{compression}_{concurrency}_{mode}.json
JSON structure:
{
"framework": "dubbo-go",
"payload_size": 1024,
"serialization": "protobuf",
"compression": "none",
"concurrency": 100,
"call_mode": "unary",
"timestamp": "2026-07-23 15:00:00",
"qps": 21450.0,
"success_rate": 99.99,
"latency_p50_ms": 4.65,
"latency_p99_ms": 5.53,
"cpu_avg_percent": 45.2,
"memory_peak_mb": 128.5
}Logs are saved in logs/ directory, including:
-
{scenario}.log- Client benchmark logs -
{scenario}.server.log- Server runtime logs
For best performance, Dubbo-Go client uses the following optimizations:
| Configuration | Description |
|---|---|
WithClientNoCheck() |
Skip service check, reduce unnecessary overhead |
MaxCallRecvMsgSize: 16MB |
Max receive message size for large payload tests |
MaxCallSendMsgSize: 16MB |
Max send message size for large payload tests |
Server configuration includes the following optimizations:
| Configuration | Description |
|---|---|
WithMaxServerRecvMsgSize("16MB") |
Max receive message size |
WithMaxServerSendMsgSize("16MB") |
Max send message size |
Apache License 2.0