RPC Benchmark,Dubbo墊底

rpc-benchmark 說明及答疑java

幾乎全部的 RPC 框架都宣稱本身是「高性能」的, 那麼實際結果到底如何呢, 讓咱們來作一個性能測試吧.

項目地址:git

  https://github.com/hank-whu/rpc-benchmarkgithub

  https://gitee.com/hank-whu/rpc-benchmarkweb

測試說明

  • 僅限於Java.
  • 客戶端使用JMH進行壓測, 32 線程, 10 次預熱, 3 次運行.
  • 每次運行前都會執行 killall java, 但沒有在每輪測試時重啓操做系統.
  • 全部類庫版本在發佈時都是最新的, 除非存在bug.
  • 全部框架都儘可能參考該項目自帶的Benchmark實現.
  • 將會一直持續, 不按期發佈測試結果.

測試用例

  1. boolean existUser(String email), 判斷某個 email 是否存在.
  2. boolean createUser(User user), 添加一個 User.
  3. User getUser(long id), 根據 id 獲取一個用戶.
  4. Page<User> listUser(int pageNo), 獲取用戶列表.

運行結果

生成時間: 2018-01-28 14:36:24.

硬件環境: 阿里雲 ecs.c4.xlarge, Intel Xeon E5-2667v4, 4CPU 8GB RAM 兩臺.

軟件環境: Ubuntu x64 16.04.5, Java HotSpot(TM) 64-Bit Server VM 9.0.4+11.

啓動參數: java -server -Xmx1g -Xms1g -XX:MaxDirectMemorySize=1g -XX:+UseG1GC.spring

existUser 判斷某個 email 是否存在

framework thrpt (ops/ms) avgt (ms) p90 (ms) p99 (ms) p999 (ms)
turbo-rpc 107.05 0.28 0.40 0.87 4.06
netty 99.81 0.32 0.40 0.52 1.16
jupiter 73.07 0.44 0.66 1.49 2.92
undertow 70.38 0.45 1.16 2.17 32.48
turbo-rest 68.49 0.44 1.17 2.15 25.66
undertow-async 62.65 0.49 1.14 2.41 24.84
dubbo-kryo 57.35 0.53 0.67 1.02 11.65
rapidoid 52.96 0.61 1.32 2.51 25.07
dubbo 52.12 0.54 0.67 0.92 3.93
motan 44.96 0.71 1.15 2.47 33.39
aeron 43.46 0.90 1.32 5.10 14.29
grpc 38.97 0.84 1.07 1.31 6.06
thrift 27.25 1.59 0.16 64.87 122.83
hprose 26.24 1.26 1.53 2.01 8.34
springwebflux 22.39 1.42 2.27 3.19 17.20
springboot 12.54 1.68 2.38 13.63 33.20

createUser 添加一個 User

framework thrpt (ops/ms) avgt (ms) p90 (ms) p99 (ms) p999 (ms)
turbo-rpc 84.95 0.39 0.50 1.45 4.01
netty 76.45 0.48 0.49 0.79 1.87
jupiter 64.57 0.50 0.68 1.37 2.79
undertow 62.47 0.51 1.17 2.76 20.10
turbo-rest 58.21 0.57 1.23 2.84 22.35
undertow-async 56.19 0.59 1.36 3.73 24.50
dubbo-kryo 42.37 0.72 0.94 1.33 16.75
motan 42.16 0.79 1.23 2.39 30.97
grpc 41.56 0.77 0.93 1.24 4.41
aeron 37.74 0.89 1.35 3.85 22.98
dubbo 28.75 1.13 1.42 1.82 16.06
thrift 25.66 1.47 0.17 68.71 130.93
hprose 23.30 1.31 1.44 2.28 13.36
rapidoid 18.54 1.73 1.27 25.10 40.47
springwebflux 10.51 1.50 2.33 3.37 21.30
springboot 9.43 1.75 2.57 12.81 24.90

getUser 根據 id 獲取一個用戶

framework thrpt (ops/ms) avgt (ms) p90 (ms) p99 (ms) p999 (ms)
turbo-rpc 95.92 0.38 0.49 1.52 2.96
jupiter 63.61 0.52 0.74 1.37 2.50
netty 63.44 0.44 0.50 0.55 0.97
undertow-async 57.50 0.58 1.23 2.32 5.02
undertow 55.70 0.55 1.32 2.54 11.60
turbo-rest 53.34 0.59 1.49 2.72 23.69
dubbo-kryo 46.44 0.69 0.85 1.16 18.09
rapidoid 43.84 0.74 1.99 4.78 18.35
grpc 41.58 0.75 0.90 1.19 4.57
motan 40.62 0.78 1.25 2.68 34.18
dubbo 29.11 1.11 1.44 1.98 16.73
thrift 27.14 1.74 0.19 0.29 362.63
hprose 23.91 1.40 1.56 2.31 47.06
springwebflux 19.24 1.67 2.70 3.62 14.94
springboot 18.71 1.70 2.17 14.76 31.09
aeron 18.25 1.71 3.94 13.15 63.77

listUser 獲取用戶列表

framework thrpt (ops/ms) avgt (ms) p90 (ms) p99 (ms) p999 (ms)
turbo-rpc 44.53 0.82 1.37 2.85 10.39
grpc 30.67 1.05 1.31 1.68 15.12
undertow 28.38 1.21 1.72 4.49 23.25
motan 28.08 1.13 1.80 3.22 21.56
undertow-async 28.05 1.16 1.76 6.75 20.91
jupiter 26.59 1.20 2.00 4.04 25.00
netty 24.28 1.29 1.35 1.83 5.97
rapidoid 20.73 1.56 3.29 16.50 29.89
dubbo-kryo 19.55 1.69 2.36 3.37 16.85
turbo-rest 17.56 2.17 2.67 17.02 37.50
springwebflux 16.21 2.00 3.13 4.90 17.66
springboot 15.84 2.16 2.72 16.81 36.64
thrift 14.87 2.61 0.26 0.42 518.96
hprose 13.19 2.70 2.85 4.01 54.52
aeron 4.53 7.13 10.42 16.47 30.30
dubbo 4.52 7.04 9.06 12.52 16.02

免責聲明

  • 能力所限錯誤在所不免, 本測試用例及測試結果僅供參考.
  • 若是你認爲xx框架的代碼或配置存在問題,那麼歡迎發起Pull Request.
  • 利益相關: 本測試用例做者同時爲 turboundertow-async 的做者.

rpc-benchmark 說明及答疑api

相關文章
相關標籤/搜索