[apache/dubbo]Triple协议性能优化

2024-06-24 812 views
1
  1. 完成triple协议的性能基准,grpc的性能基准
  2. 基于基准值完成triple的性能优化,接近于grpc的性能基准
  3. 沉淀一些性能分析和优化的文档

回答

2

https://github.com/apache/dubbo-samples/pull/516

  1. 增加使用基准测试的代码

dubbo版本3.1.0

jdk8和jdk17性能差距也非常大

jdk17

grpc的unary单线程阻塞模式下: 8K ops/s tri的unary单线程阻塞模式下:4.6K ops/s grpc-client=>tri-server的unary单线程阻塞模式下: 6K ops/s

jdk8

grpc的unary单线程阻塞模式下: <7.1K ops/s tri的unary单线程阻塞模式下:<3.9K ops/s grpc-client=>tri-server的unary单线程阻塞模式下: <5.5K ops/s

6

以下数据均通过dubbo-benchmarklistUser方法得出 ,序列化均为protobuf

环境信息:
macOS 10.15.7
CPU:6核
内存:16G
JDK: 1.8.0_231

优化前triple(3.0.11)

# Warmup Iteration Benchmark

优化后的triple(增长约25%)

# Warmup Iteration Benchmark

附加一份grpc的测试数据,grpc同基于HTTP2,可作为参照

# Warmup Iteration Benchmark
3

当前进度:

  1. 已调整dubbo-samples里的dubbo-samples-triple用例
  2. 已调整PR代码并能跑通dubbo-samples-triple,待提交
4

当前进展:

  1. 性能调优PR已将测试案例全部跑通,性能该PR性能提高约30%
  2. 当前PR中存在待改进的点如WriteQueue,该优化点遇到个小问题暂未开始
8
  1. 使用jprofile跑出来的火焰图耗时部分的优化效果不明显
  2. @icodening 通过tcpdump发现碎包比grpc多几倍 结合以上两点得出结论基本的消耗应该都是在io层(使用网络层的部分代码)

基于 @icodening 的思路减少多次flush,合并flush的模式

jdk17

tri的unary单线程阻塞模式下:5.7K ops/s grpc-client=>tri-server的unary单线程阻塞模式下: 7.5K ops/s

3

已经的准备提交的features

  1. WriteQueue支持enqueueSoon模式(减少flush的次数)
  2. Client里面的UNARY下去掉EndStreamQueueCommand,参考grpc在data的frame已经描述了endstream(服务端会少一次schedule调度)

今天做了几个测试

  1. 服务端不使用SerializationExec线程,直接在Netty线程下做,效率从4500提升到6000左右(+40%),调度影响性能
  2. tri client增加filter直接使用grpc代替底层的实现调用,性能基本4500提升到5600左右(+35%),如果把服务端换成grpc的实现还是可以到7500(基本等于grpc客户端调用grpc服务端),5500=>7500这部分应该是服务端的性能损失,结合1的情况,grpc一共两次调度,目前tri是3次调度,最后一次是无效的EndStreamQueueCommand
6
问题记录 2023.2.27

经排查,发现Triple性能与GRPC相差还是很大的原因为Netty自身过多的flush导致.

本地修复后加上#10754 的改动,benchmark结果大幅提高已接近GRPC. 结果如下

triple pb优化前(3.2.0-beta.5-SNAPSHOT)
ClientPb.createUser  thrpt    3  32.438 ± 20.453  ops/ms
ClientPb.existUser   thrpt    3  33.422 ± 12.777  ops/ms
ClientPb.getUser     thrpt    3  31.160 ±  6.160  ops/ms
ClientPb.listUser    thrpt    3  24.088 ± 10.610  ops/ms
triple pb优化后
ClientPb.createUser  thrpt    3  40.651 ±  8.005  ops/ms
ClientPb.existUser   thrpt    3  43.962 ± 14.142  ops/ms
ClientPb.getUser     thrpt    3  43.787 ± 16.051  ops/ms
ClientPb.listUser    thrpt    3  34.687 ± 16.897  ops/ms
grpc
ClientGrpc.createUser  thrpt    3  42.596 ±  4.052  ops/ms
ClientGrpc.existUser   thrpt    3  48.518 ± 32.249  ops/ms
ClientGrpc.getUser     thrpt    3  45.398 ± 19.720  ops/ms
ClientGrpc.listUser    thrpt    3  36.965 ±  6.666  ops/ms
netty本地改动点

doBegin中注释了flush

image

由于涉及netty源码改动,triple侧性能调优待定。

6
image
5
Dubbo Beanchmark 记录

测试时间: 2023.03.16

triple pb 3.2 优化后

(包含#11723, #10754)

Benchmark                                 Mode      Cnt   Score   Error   Units
ClientPb.createUser                      thrpt        3  49.027 ± 6.197  ops/ms
ClientPb.existUser                       thrpt        3  50.066 ± 5.444  ops/ms
ClientPb.getUser                         thrpt        3  49.490 ± 6.517  ops/ms
ClientPb.listUser                        thrpt        3  35.464 ± 5.607  ops/ms
ClientPb.createUser                       avgt        3   0.672 ± 0.101   ms/op
ClientPb.existUser                        avgt        3   0.646 ± 0.124   ms/op
ClientPb.getUser                          avgt        3   0.667 ± 0.187   ms/op
ClientPb.listUser                         avgt        3   0.925 ± 0.015   ms/op
ClientPb.createUser                     sample  1445843   0.663 ± 0.001   ms/op
ClientPb.createUser:createUser·p0.00    sample            0.220           ms/op
ClientPb.createUser:createUser·p0.50    sample            0.597           ms/op
ClientPb.createUser:createUser·p0.90    sample            0.831           ms/op
ClientPb.createUser:createUser·p0.95    sample            1.013           ms/op
ClientPb.createUser:createUser·p0.99    sample            2.159           ms/op
ClientPb.createUser:createUser·p0.999   sample            5.128           ms/op
ClientPb.createUser:createUser·p0.9999  sample           16.840           ms/op
ClientPb.createUser:createUser·p1.00    sample           26.673           ms/op
ClientPb.existUser                      sample  1482351   0.647 ± 0.001   ms/op
ClientPb.existUser:existUser·p0.00      sample            0.200           ms/op
ClientPb.existUser:existUser·p0.50      sample            0.593           ms/op
ClientPb.existUser:existUser·p0.90      sample            0.810           ms/op
ClientPb.existUser:existUser·p0.95      sample            0.947           ms/op
ClientPb.existUser:existUser·p0.99      sample            1.914           ms/op
ClientPb.existUser:existUser·p0.999     sample            4.268           ms/op
ClientPb.existUser:existUser·p0.9999    sample           16.495           ms/op
ClientPb.existUser:existUser·p1.00      sample           21.135           ms/op
ClientPb.getUser                        sample  1442503   0.665 ± 0.001   ms/op
ClientPb.getUser:getUser·p0.00          sample            0.185           ms/op
ClientPb.getUser:getUser·p0.50          sample            0.610           ms/op
ClientPb.getUser:getUser·p0.90          sample            0.839           ms/op
ClientPb.getUser:getUser·p0.95          sample            0.949           ms/op
ClientPb.getUser:getUser·p0.99          sample            1.886           ms/op
ClientPb.getUser:getUser·p0.999         sample            4.219           ms/op
ClientPb.getUser:getUser·p0.9999        sample           16.843           ms/op
ClientPb.getUser:getUser·p1.00          sample           21.987           ms/op
ClientPb.listUser                       sample  1054998   0.909 ± 0.001   ms/op
ClientPb.listUser:listUser·p0.00        sample            0.311           ms/op
ClientPb.listUser:listUser·p0.50        sample            0.923           ms/op
ClientPb.listUser:listUser·p0.90        sample            0.963           ms/op
ClientPb.listUser:listUser·p0.95        sample            1.012           ms/op
ClientPb.listUser:listUser·p0.99        sample            1.370           ms/op
ClientPb.listUser:listUser·p0.999       sample            5.513           ms/op
ClientPb.listUser:listUser·p0.9999      sample           11.526           ms/op
ClientPb.listUser:listUser·p1.00        sample           20.283           ms/op

dubbo grpc 3.1.7
Benchmark                                   Mode      Cnt   Score   Error   Units
ClientGrpc.createUser                      thrpt        3  44.912 ± 0.247  ops/ms
ClientGrpc.existUser                       thrpt        3  45.385 ± 0.521  ops/ms
ClientGrpc.getUser                         thrpt        3  44.860 ± 1.071  ops/ms
ClientGrpc.listUser                        thrpt        3  37.039 ± 4.657  ops/ms
ClientGrpc.createUser                       avgt        3   0.715 ± 0.016   ms/op
ClientGrpc.existUser                        avgt        3   0.701 ± 0.019   ms/op
ClientGrpc.getUser                          avgt        3   0.720 ± 0.023   ms/op
ClientGrpc.listUser                         avgt        3   0.872 ± 0.097   ms/op
ClientGrpc.createUser                     sample  1318795   0.727 ± 0.001   ms/op
ClientGrpc.createUser:createUser·p0.00    sample            0.135           ms/op
ClientGrpc.createUser:createUser·p0.50    sample            0.703           ms/op
ClientGrpc.createUser:createUser·p0.90    sample            0.933           ms/op
ClientGrpc.createUser:createUser·p0.95    sample            1.020           ms/op
ClientGrpc.createUser:createUser·p0.99    sample            1.303           ms/op
ClientGrpc.createUser:createUser·p0.999   sample            4.407           ms/op
ClientGrpc.createUser:createUser·p0.9999  sample           16.026           ms/op
ClientGrpc.createUser:createUser·p1.00    sample           28.541           ms/op
ClientGrpc.existUser                      sample  1345875   0.713 ± 0.001   ms/op
ClientGrpc.existUser:existUser·p0.00      sample            0.149           ms/op
ClientGrpc.existUser:existUser·p0.50      sample            0.697           ms/op
ClientGrpc.existUser:existUser·p0.90      sample            0.886           ms/op
ClientGrpc.existUser:existUser·p0.95      sample            0.952           ms/op
ClientGrpc.existUser:existUser·p0.99      sample            1.161           ms/op
ClientGrpc.existUser:existUser·p0.999     sample            3.584           ms/op
ClientGrpc.existUser:existUser·p0.9999    sample           15.991           ms/op
ClientGrpc.existUser:existUser·p1.00      sample           23.101           ms/op
ClientGrpc.getUser                        sample  1321640   0.726 ± 0.001   ms/op
ClientGrpc.getUser:getUser·p0.00          sample            0.160           ms/op
ClientGrpc.getUser:getUser·p0.50          sample            0.710           ms/op
ClientGrpc.getUser:getUser·p0.90          sample            0.903           ms/op
ClientGrpc.getUser:getUser·p0.95          sample            0.975           ms/op
ClientGrpc.getUser:getUser·p0.99          sample            1.272           ms/op
ClientGrpc.getUser:getUser·p0.999         sample            4.138           ms/op
ClientGrpc.getUser:getUser·p0.9999        sample           16.444           ms/op
ClientGrpc.getUser:getUser·p1.00          sample           36.307           ms/op
ClientGrpc.listUser                       sample  1116980   0.859 ± 0.002   ms/op
ClientGrpc.listUser:listUser·p0.00        sample            0.196           ms/op
ClientGrpc.listUser:listUser·p0.50        sample            0.760           ms/op
ClientGrpc.listUser:listUser·p0.90        sample            1.192           ms/op
ClientGrpc.listUser:listUser·p0.95        sample            1.393           ms/op
ClientGrpc.listUser:listUser·p0.99        sample            2.261           ms/op
ClientGrpc.listUser:listUser·p0.999       sample           10.634           ms/op
ClientGrpc.listUser:listUser·p0.9999      sample           16.417           ms/op
ClientGrpc.listUser:listUser·p1.00        sample           30.867           ms/op

triple pb 3.1.7
Benchmark                                 Mode     Cnt   Score   Error   Units
ClientPb.createUser                      thrpt       3  27.477 ± 4.047  ops/ms
ClientPb.existUser                       thrpt       3  29.037 ± 1.925  ops/ms
ClientPb.getUser                         thrpt       3  28.473 ± 3.579  ops/ms
ClientPb.listUser                        thrpt       3  24.793 ± 8.987  ops/ms
ClientPb.createUser                       avgt       3   1.168 ± 0.033   ms/op
ClientPb.existUser                        avgt       3   1.084 ± 0.087   ms/op
ClientPb.getUser                          avgt       3   1.092 ± 0.040   ms/op
ClientPb.listUser                         avgt       3   1.232 ± 0.157   ms/op
ClientPb.createUser                     sample  827302   1.159 ± 0.002   ms/op
ClientPb.createUser:createUser·p0.00    sample           0.319           ms/op
ClientPb.createUser:createUser·p0.50    sample           1.153           ms/op
ClientPb.createUser:createUser·p0.90    sample           1.630           ms/op
ClientPb.createUser:createUser·p0.95    sample           1.659           ms/op
ClientPb.createUser:createUser·p0.99    sample           1.733           ms/op
ClientPb.createUser:createUser·p0.999   sample           5.980           ms/op
ClientPb.createUser:createUser·p0.9999  sample          20.423           ms/op
ClientPb.createUser:createUser·p1.00    sample          30.900           ms/op
ClientPb.existUser                      sample  868942   1.104 ± 0.002   ms/op
ClientPb.existUser:existUser·p0.00      sample           0.366           ms/op
ClientPb.existUser:existUser·p0.50      sample           1.120           ms/op
ClientPb.existUser:existUser·p0.90      sample           1.606           ms/op
ClientPb.existUser:existUser·p0.95      sample           1.645           ms/op
ClientPb.existUser:existUser·p0.99      sample           1.704           ms/op
ClientPb.existUser:existUser·p0.999     sample           6.128           ms/op
ClientPb.existUser:existUser·p0.9999    sample          18.055           ms/op
ClientPb.existUser:existUser·p1.00      sample          25.068           ms/op
ClientPb.getUser                        sample  866952   1.106 ± 0.002   ms/op
ClientPb.getUser:getUser·p0.00          sample           0.365           ms/op
ClientPb.getUser:getUser·p0.50          sample           1.116           ms/op
ClientPb.getUser:getUser·p0.90          sample           1.380           ms/op
ClientPb.getUser:getUser·p0.95          sample           1.675           ms/op
ClientPb.getUser:getUser·p0.99          sample           1.757           ms/op
ClientPb.getUser:getUser·p0.999         sample           6.922           ms/op
ClientPb.getUser:getUser·p0.9999        sample          19.802           ms/op
ClientPb.getUser:getUser·p1.00          sample          25.723           ms/op
ClientPb.listUser                       sample  780662   1.229 ± 0.002   ms/op
ClientPb.listUser:listUser·p0.00        sample           0.366           ms/op
ClientPb.listUser:listUser·p0.50        sample           1.180           ms/op
ClientPb.listUser:listUser·p0.90        sample           1.659           ms/op
ClientPb.listUser:listUser·p0.95        sample           1.702           ms/op
ClientPb.listUser:listUser·p0.99        sample           2.339           ms/op
ClientPb.listUser:listUser·p0.999       sample          10.060           ms/op
ClientPb.listUser:listUser·p0.9999      sample          18.547           ms/op
ClientPb.listUser:listUser·p1.00        sample          22.577           ms/op

triple pb 3.2 优化后

(不含#10754, 包含#11723)

Benchmark                                 Mode      Cnt   Score    Error   Units
ClientPb.createUser                      thrpt        3  45.657 ±  5.804  ops/ms
ClientPb.existUser                       thrpt        3  47.427 ±  7.432  ops/ms
ClientPb.getUser                         thrpt        3  43.813 ± 15.298  ops/ms
ClientPb.listUser                        thrpt        3  31.987 ±  3.103  ops/ms
ClientPb.createUser                       avgt        3   0.734 ±  0.106   ms/op
ClientPb.existUser                        avgt        3   0.684 ±  0.304   ms/op
ClientPb.getUser                          avgt        3   0.722 ±  0.086   ms/op
ClientPb.listUser                         avgt        3   1.007 ±  0.105   ms/op
ClientPb.createUser                     sample  1266772   0.757 ±  0.001   ms/op
ClientPb.createUser:createUser·p0.00    sample            0.179            ms/op
ClientPb.createUser:createUser·p0.50    sample            0.718            ms/op
ClientPb.createUser:createUser·p0.90    sample            0.933            ms/op
ClientPb.createUser:createUser·p0.95    sample            1.010            ms/op
ClientPb.createUser:createUser·p0.99    sample            1.364            ms/op
ClientPb.createUser:createUser·p0.999   sample            6.586            ms/op
ClientPb.createUser:createUser·p0.9999  sample           16.214            ms/op
ClientPb.createUser:createUser·p1.00    sample           25.559            ms/op
ClientPb.existUser                      sample  1364860   0.703 ±  0.001   ms/op
ClientPb.existUser:existUser·p0.00      sample            0.176            ms/op
ClientPb.existUser:existUser·p0.50      sample            0.655            ms/op
ClientPb.existUser:existUser·p0.90      sample            0.867            ms/op
ClientPb.existUser:existUser·p0.95      sample            0.948            ms/op
ClientPb.existUser:existUser·p0.99      sample            1.438            ms/op
ClientPb.existUser:existUser·p0.999     sample            5.874            ms/op
ClientPb.existUser:existUser·p0.9999    sample           16.425            ms/op
ClientPb.existUser:existUser·p1.00      sample           26.903            ms/op
ClientPb.getUser                        sample  1306546   0.734 ±  0.001   ms/op
ClientPb.getUser:getUser·p0.00          sample            0.230            ms/op
ClientPb.getUser:getUser·p0.50          sample            0.676            ms/op
ClientPb.getUser:getUser·p0.90          sample            0.896            ms/op
ClientPb.getUser:getUser·p0.95          sample            0.984            ms/op
ClientPb.getUser:getUser·p0.99          sample            2.216            ms/op
ClientPb.getUser:getUser·p0.999         sample            7.045            ms/op
ClientPb.getUser:getUser·p0.9999        sample           16.843            ms/op
ClientPb.getUser:getUser·p1.00          sample           26.608            ms/op
ClientPb.listUser                       sample   952545   1.007 ±  0.002   ms/op
ClientPb.listUser:listUser·p0.00        sample            0.250            ms/op
ClientPb.listUser:listUser·p0.50        sample            0.961            ms/op
ClientPb.listUser:listUser·p0.90        sample            1.229            ms/op
ClientPb.listUser:listUser·p0.95        sample            1.339            ms/op
ClientPb.listUser:listUser·p0.99        sample            2.322            ms/op
ClientPb.listUser:listUser·p0.999       sample            8.130            ms/op
ClientPb.listUser:listUser·p0.9999      sample           14.270            ms/op
ClientPb.listUser:listUser·p1.00        sample           20.152            ms/op

triple wrapper 3.2
Benchmark                               Mode      Cnt   Score   Error   Units
Client.createUser                      thrpt        3  35.238 ± 0.414  ops/ms
Client.existUser                       thrpt        3  48.482 ± 7.336  ops/ms
Client.getUser                         thrpt        3  35.820 ± 1.324  ops/ms
Client.listUser                        thrpt        3   4.914 ± 1.897  ops/ms
Client.createUser                       avgt        3   0.918 ± 0.020   ms/op
Client.existUser                        avgt        3   0.668 ± 0.040   ms/op
Client.getUser                          avgt        3   0.902 ± 0.099   ms/op
Client.listUser                         avgt        3   6.310 ± 4.232   ms/op
Client.createUser                     sample  1043729   0.919 ± 0.002   ms/op
Client.createUser:createUser·p0.00    sample            0.241           ms/op
Client.createUser:createUser·p0.50    sample            0.844           ms/op
Client.createUser:createUser·p0.90    sample            1.251           ms/op
Client.createUser:createUser·p0.95    sample            1.501           ms/op
Client.createUser:createUser·p0.99    sample            2.552           ms/op
Client.createUser:createUser·p0.999   sample            5.325           ms/op
Client.createUser:createUser·p0.9999  sample           19.268           ms/op
Client.createUser:createUser·p1.00    sample           27.394           ms/op
Client.existUser                      sample  1430422   0.670 ± 0.001   ms/op
Client.existUser:existUser·p0.00      sample            0.192           ms/op
Client.existUser:existUser·p0.50      sample            0.609           ms/op
Client.existUser:existUser·p0.90      sample            0.846           ms/op
Client.existUser:existUser·p0.95      sample            1.010           ms/op
Client.existUser:existUser·p0.99      sample            2.027           ms/op
Client.existUser:existUser·p0.999     sample            4.604           ms/op
Client.existUser:existUser·p0.9999    sample           16.072           ms/op
Client.existUser:existUser·p1.00      sample           21.922           ms/op
Client.getUser                        sample  1066609   0.900 ± 0.001   ms/op
Client.getUser:getUser·p0.00          sample            0.322           ms/op
Client.getUser:getUser·p0.50          sample            0.900           ms/op
Client.getUser:getUser·p0.90          sample            0.962           ms/op
Client.getUser:getUser·p0.95          sample            0.997           ms/op
Client.getUser:getUser·p0.99          sample            1.188           ms/op
Client.getUser:getUser·p0.999         sample            4.460           ms/op
Client.getUser:getUser·p0.9999        sample           15.920           ms/op
Client.getUser:getUser·p1.00          sample           24.281           ms/op
Client.listUser                       sample   157895   6.075 ± 0.009   ms/op
Client.listUser:listUser·p0.00        sample            3.752           ms/op
Client.listUser:listUser·p0.50        sample            6.816           ms/op
Client.listUser:listUser·p0.90        sample            7.119           ms/op
Client.listUser:listUser·p0.95        sample            7.168           ms/op
Client.listUser:listUser·p0.99        sample            7.504           ms/op
Client.listUser:listUser·p0.999       sample           18.645           ms/op
Client.listUser:listUser·p0.9999      sample           21.234           ms/op
Client.listUser:listUser·p1.00        sample           21.266           ms/op 

dubbo fastjson2 3.2
Benchmark                               Mode      Cnt    Score    Error   Units
Client.createUser                      thrpt        3  133.550 ± 23.083  ops/ms
Client.existUser                       thrpt        3  141.933 ±  6.886  ops/ms
Client.getUser                         thrpt        3  132.112 ± 17.650  ops/ms
Client.listUser                        thrpt        3   58.811 ±  0.784  ops/ms
Client.createUser                       avgt        3    0.240 ±  0.010   ms/op
Client.existUser                        avgt        3    0.223 ±  0.026   ms/op
Client.getUser                          avgt        3    0.247 ±  0.039   ms/op
Client.listUser                         avgt        3    0.656 ±  0.051   ms/op
Client.createUser                     sample  3957573    0.242 ±  0.001   ms/op
Client.createUser:createUser·p0.00    sample             0.076            ms/op
Client.createUser:createUser·p0.50    sample             0.224            ms/op
Client.createUser:createUser·p0.90    sample             0.325            ms/op
Client.createUser:createUser·p0.95    sample             0.372            ms/op
Client.createUser:createUser·p0.99    sample             0.570            ms/op
Client.createUser:createUser·p0.999   sample             1.221            ms/op
Client.createUser:createUser·p0.9999  sample             8.421            ms/op
Client.createUser:createUser·p1.00    sample            19.431            ms/op
Client.existUser                      sample  4271589    0.224 ±  0.001   ms/op
Client.existUser:existUser·p0.00      sample             0.074            ms/op
Client.existUser:existUser·p0.50      sample             0.214            ms/op
Client.existUser:existUser·p0.90      sample             0.285            ms/op
Client.existUser:existUser·p0.95      sample             0.312            ms/op
Client.existUser:existUser·p0.99      sample             0.405            ms/op
Client.existUser:existUser·p0.999     sample             1.153            ms/op
Client.existUser:existUser·p0.9999    sample             8.338            ms/op
Client.existUser:existUser·p1.00      sample            19.497            ms/op
Client.getUser                        sample  3910959    0.245 ±  0.001   ms/op
Client.getUser:getUser·p0.00          sample             0.074            ms/op
Client.getUser:getUser·p0.50          sample             0.223            ms/op
Client.getUser:getUser·p0.90          sample             0.338            ms/op
Client.getUser:getUser·p0.95          sample             0.394            ms/op
Client.getUser:getUser·p0.99          sample             0.635            ms/op
Client.getUser:getUser·p0.999         sample             1.247            ms/op
Client.getUser:getUser·p0.9999        sample             8.995            ms/op
Client.getUser:getUser·p1.00          sample            22.479            ms/op
Client.listUser                       sample  1742949    0.550 ±  0.001   ms/op
Client.listUser:listUser·p0.00        sample             0.114            ms/op
Client.listUser:listUser·p0.50        sample             0.510            ms/op
Client.listUser:listUser·p0.90        sample             0.784            ms/op
Client.listUser:listUser·p0.95        sample             0.890            ms/op
Client.listUser:listUser·p0.99        sample             1.200            ms/op
Client.listUser:listUser·p0.999       sample             3.482            ms/op
Client.listUser:listUser·p0.9999      sample             9.907            ms/op
Client.listUser:listUser·p1.00        sample            16.286            ms/op

dubbo hessianlite 3.2
Benchmark                               Mode      Cnt    Score    Error   Units
Client.createUser                      thrpt        3   69.389 ±  3.781  ops/ms
Client.existUser                       thrpt        3  145.362 ± 14.708  ops/ms
Client.getUser                         thrpt        3   66.922 ±  3.802  ops/ms
Client.listUser                        thrpt        3   10.791 ±  0.251  ops/ms
Client.createUser                       avgt        3    0.486 ±  0.032   ms/op
Client.existUser                        avgt        3    0.223 ±  0.017   ms/op
Client.getUser                          avgt        3    0.492 ±  0.015   ms/op
Client.listUser                         avgt        3    2.939 ±  0.070   ms/op
Client.createUser                     sample  1931706    0.496 ±  0.001   ms/op
Client.createUser:createUser·p0.00    sample             0.110            ms/op
Client.createUser:createUser·p0.50    sample             0.453            ms/op
Client.createUser:createUser·p0.90    sample             0.714            ms/op
Client.createUser:createUser·p0.95    sample             0.821            ms/op
Client.createUser:createUser·p0.99    sample             1.208            ms/op
Client.createUser:createUser·p0.999   sample             3.088            ms/op
Client.createUser:createUser·p0.9999  sample            14.825            ms/op
Client.createUser:createUser·p1.00    sample            23.560            ms/op
Client.existUser                      sample  4329255    0.221 ±  0.001   ms/op
Client.existUser:existUser·p0.00      sample             0.071            ms/op
Client.existUser:existUser·p0.50      sample             0.211            ms/op
Client.existUser:existUser·p0.90      sample             0.275            ms/op
Client.existUser:existUser·p0.95      sample             0.302            ms/op
Client.existUser:existUser·p0.99      sample             0.425            ms/op
Client.existUser:existUser·p0.999     sample             1.143            ms/op
Client.existUser:existUser·p0.9999    sample             7.906            ms/op
Client.existUser:existUser·p1.00      sample            21.103            ms/op
Client.getUser                        sample  1935915    0.495 ±  0.001   ms/op
Client.getUser:getUser·p0.00          sample             0.109            ms/op
Client.getUser:getUser·p0.50          sample             0.452            ms/op
Client.getUser:getUser·p0.90          sample             0.712            ms/op
Client.getUser:getUser·p0.95          sample             0.814            ms/op
Client.getUser:getUser·p0.99          sample             1.190            ms/op
Client.getUser:getUser·p0.999         sample             3.023            ms/op
Client.getUser:getUser·p0.9999        sample            14.752            ms/op
Client.getUser:getUser·p1.00          sample            24.117            ms/op
Client.listUser                       sample   326372    2.941 ±  0.009   ms/op
Client.listUser:listUser·p0.00        sample             0.550            ms/op
Client.listUser:listUser·p0.50        sample             2.613            ms/op
Client.listUser:listUser·p0.90        sample             4.440            ms/op
Client.listUser:listUser·p0.95        sample             5.415            ms/op
Client.listUser:listUser·p0.99        sample             8.688            ms/op
Client.listUser:listUser·p0.999       sample            17.682            ms/op
Client.listUser:listUser·p0.9999      sample            25.759            ms/op
Client.listUser:listUser·p1.00        sample            39.059            ms/op

dubbo pb 3.2
Benchmark                                 Mode      Cnt    Score    Error   Units
ClientPb.createUser                      thrpt        3  108.287 ± 12.040  ops/ms
ClientPb.existUser                       thrpt        3  120.115 ± 21.917  ops/ms
ClientPb.getUser                         thrpt        3  112.188 ± 32.633  ops/ms
ClientPb.listUser                        thrpt        3   59.005 ± 10.768  ops/ms
ClientPb.createUser                       avgt        3    0.297 ±  0.139   ms/op
ClientPb.existUser                        avgt        3    0.266 ±  0.053   ms/op
ClientPb.getUser                          avgt        3    0.290 ±  0.069   ms/op
ClientPb.listUser                         avgt        3    0.523 ±  0.032   ms/op
ClientPb.createUser                     sample  3273529    0.293 ±  0.001   ms/op
ClientPb.createUser:createUser·p0.00    sample             0.081            ms/op
ClientPb.createUser:createUser·p0.50    sample             0.260            ms/op
ClientPb.createUser:createUser·p0.90    sample             0.431            ms/op
ClientPb.createUser:createUser·p0.95    sample             0.528            ms/op
ClientPb.createUser:createUser·p0.99    sample             0.863            ms/op
ClientPb.createUser:createUser·p0.999   sample             1.774            ms/op
ClientPb.createUser:createUser·p0.9999  sample            10.076            ms/op
ClientPb.createUser:createUser·p1.00    sample            22.675            ms/op
ClientPb.existUser                      sample  3650340    0.263 ±  0.001   ms/op
ClientPb.existUser:existUser·p0.00      sample             0.077            ms/op
ClientPb.existUser:existUser·p0.50      sample             0.233            ms/op
ClientPb.existUser:existUser·p0.90      sample             0.374            ms/op
ClientPb.existUser:existUser·p0.95      sample             0.454            ms/op
ClientPb.existUser:existUser·p0.99      sample             0.776            ms/op
ClientPb.existUser:existUser·p0.999     sample             1.518            ms/op
ClientPb.existUser:existUser·p0.9999    sample             8.962            ms/op
ClientPb.existUser:existUser·p1.00      sample            20.480            ms/op
ClientPb.getUser                        sample  3290595    0.291 ±  0.001   ms/op
ClientPb.getUser:getUser·p0.00          sample             0.075            ms/op
ClientPb.getUser:getUser·p0.50          sample             0.257            ms/op
ClientPb.getUser:getUser·p0.90          sample             0.429            ms/op
ClientPb.getUser:getUser·p0.95          sample             0.528            ms/op
ClientPb.getUser:getUser·p0.99          sample             0.883            ms/op
ClientPb.getUser:getUser·p0.999         sample             1.839            ms/op
ClientPb.getUser:getUser·p0.9999        sample             9.273            ms/op
ClientPb.getUser:getUser·p1.00          sample            25.297            ms/op
ClientPb.listUser                       sample  1763003    0.544 ±  0.001   ms/op
ClientPb.listUser:listUser·p0.00        sample             0.118            ms/op
ClientPb.listUser:listUser·p0.50        sample             0.502            ms/op
ClientPb.listUser:listUser·p0.90        sample             0.769            ms/op
ClientPb.listUser:listUser·p0.95        sample             0.869            ms/op
ClientPb.listUser:listUser·p0.99        sample             1.194            ms/op
ClientPb.listUser:listUser·p0.999       sample             3.523            ms/op
ClientPb.listUser:listUser·p0.9999      sample            10.546            ms/op
ClientPb.listUser:listUser·p1.00        sample            22.872            ms/op
4

@icodening 每次跑完测试,除了原始数据外,最好能加一个结论:相比于 grpc, dubbo/triple 的性能提升/下降 x% ,如果能再有几张对比图就更好啦

6

好的,我看剩下的PR也已经合并了,我找个时间跑一下合并后的版本再梳理一下数据吧

7

如图所示,优化后的triple协议相比优化前有着较大幅度的提升,较小报文场景createUser、existUser、getUser下,提升率约在40-45%,与gRPC基本持平。较大报文场景listUser下提升了约17%,相较于同场景下的gRPC还低11%

image