Benchmark

The benchmark code is at rpcx-ecosystem/rpcx-benchmark.

Use the same test environment, the same test data and the same test parameters, test grpc, rpcx, dubbo, motan, thrift and go-micro.

Based on my prior test, dubbo, motan and go-micro have poor performance, so their latest test have not been listed here, you can use the benchmark code to test them.

Test Logic

Use protobuf as the codec for all test. The proto file is benchmark.proto:

  1. syntax = "proto2";
  2. package main;
  3. option optimize_for = SPEED;
  4. message BenchmarkMessage {
  5. required string field1 = 1;
  6. optional string field9 = 9;
  7. optional string field18 = 18;
  8. optional bool field80 = 80 [default=false];
  9. optional bool field81 = 81 [default=true];
  10. required int32 field2 = 2;
  11. required int32 field3 = 3;
  12. ......
  13. }

Client generates a requests by setting each fields and the size of this request is 518 bytes.

Server receives this request and sets the first field to "OK" and the second field to 100, then Server returns this request to Client.

The below two options can set concurrency and the total requests.

  1. var concurrency = flag.Int("c", 1, "concurrency")
  2. var total = flag.Int("n", 1, "total requests for all clients")

Test Environment

  • CPU: Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz, 32 cores
  • Memory: 32G
  • Go: 1.9.2
  • OS: CentOS 7 / 3.10.0-229.el7.x86_64
    Client and Server are installed on the same machine.

Test Result

TPS

for 5000 concurrency, rpcx can archive 176,894 transations/second TPS, but grpc-go only gets 105219 transations/second

concurrency RPCX GRPC-GO
5000 176894 105219
2000 161660 108245
1000 148227 111351
100 145479 93447

Latency: mean time

concurrency RPCX GRPC-GO
5000 27 47
2000 12 18
1000 6 8
100 0 1

Latency: median time

concurrency RPCX GRPC-GO
5000 3 42
2000 7 15
1000 5 7
100 0 0

By smallnest updated 2018-03-27 11:12:10

原文:

http://doc.rpcx.site/part5/benchmark.html