Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

gRPC Benchmarks

JBD edited this page Mar 6, 2018 · 6 revisions

Checkout https://github.com/rakyll/grpc-go/tree/opencensus-benchmarks.

$ go get google.golang.org/grpc
$ cd $(go env GOPATH)/src/google.golang.org/grpc
$ git add remote rakyll github.com/rakyll/grpc-go
$ git checkout -b opencensus-benchmarks rakyll/opencensus-benchmarks

OpenCensus enabled

Both server-side stats and tracing is enabled.

go run benchmark/benchmain/main.go -benchtime=5s -workloads=all \
  -compression=on -maxConcurrentCalls=1 -trace=off \
  -reqSizeBytes=1,1048576 -respSizeBytes=1,1048576 -networkMode=Local \
  -opencensus-server-stats=true -opencensus-server-trace=true
Unary-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1B-respSize_1B-Compressor_true:
50_Latency: 176.6110 µs 	90_Latency: 242.8010 µs 	99_Latency: 391.6690 µs 	Avg latency: 190.8300 µs 	Count: 26173 	18219 Bytes/op	300 Allocs/op
Histogram (unit: µs)
Count: 26173  Min: 120.0  Max: 1408.2  Avg: 190.83
------------------------------------------------------------
[    120.009000,     120.010000)      1    0.0%    0.0%
[    120.010000,     120.013774)      0    0.0%    0.0%
[    120.013774,     120.031791)      0    0.0%    0.0%
[    120.031791,     120.117808)      0    0.0%    0.0%
[    120.117808,     120.528452)      0    0.0%    0.0%
[    120.528452,     122.488889)      1    0.0%    0.0%
[    122.488889,     131.848098)      3    0.0%    0.0%
[    131.848098,     176.529375)  13035   49.8%   49.8%  #####
[    176.529375,     389.839767)  12866   49.2%   99.0%  #####
[    389.839767,    1408.193000)    266    1.0%  100.0%
[   1408.193000,            inf)      1    0.0%  100.0%

Stream-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1B-respSize_1B-Compressor_true:
50_Latency: 325.6560 µs 	90_Latency: 693.8740 µs 	99_Latency: 892.0040 µs 	Avg latency: 410.7110 µs 	Count: 12167 	1166343 Bytes/op	168 Allocs/op
Histogram (unit: µs)
Count: 12167  Min: 174.5  Max: 4601.6  Avg: 410.71
------------------------------------------------------------
[    174.495000,     174.496000)      1    0.0%    0.0%
[    174.496000,     174.500476)      0    0.0%    0.0%
[    174.500476,     174.524986)      0    0.0%    0.0%
[    174.524986,     174.659200)      0    0.0%    0.0%
[    174.659200,     175.394145)      3    0.0%    0.0%
[    175.394145,     179.418652)     19    0.2%    0.2%
[    179.418652,     201.456545)    464    3.8%    4.0%
[    201.456545,     322.134391)   5523   45.4%   49.4%  #####
[    322.134391,     982.957183)   6105   50.2%   99.6%  #####
[    982.957183,    4601.573000)     51    0.4%  100.0%
[   4601.573000,            inf)      1    0.0%  100.0%

Unary-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1B-respSize_1048576B-Compressor_true:
50_Latency: 3.1220 ms 	90_Latency: 103.2311 ms 	99_Latency: 106.0511 ms 	Avg latency: 14.2033 ms 	Count: 359 10558431 Bytes/op	713 Allocs/op
Histogram (unit: ms)
Count: 359  Min:   2.4  Max: 109.8  Avg: 14.20
------------------------------------------------------------
[        2.425453,         2.425454)    1    0.3%    0.3%
[        2.425454,         2.425461)    0    0.0%    0.3%
[        2.425461,         2.425514)    0    0.0%    0.3%
[        2.425514,         2.425928)    0    0.0%    0.3%
[        2.425928,         2.429163)    0    0.0%    0.3%
[        2.429163,         2.454403)    0    0.0%    0.3%
[        2.454403,         2.651383)   10    2.8%    3.1%
[        2.651383,         4.188662)  303   84.4%   87.5%  ########
[        4.188662,        16.185914)    6    1.7%   89.1%
[       16.185914,       109.815027)   38   10.6%   99.7%  #
[      109.815027,              inf)    1    0.3%  100.0%

Stream-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1B-respSize_1048576B-Compressor_true:
50_Latency: 7.8238 ms 	90_Latency: 8.4847 ms 	99_Latency: 9.0508 ms 	Avg latency: 7.8898 ms 	Count: 634 	9569594 Bytes/op	202 Allocs/op
Histogram (unit: ms)
Count: 634  Min:   7.0  Max:  10.0  Avg: 7.89
------------------------------------------------------------
[       7.008726,        7.008727)    1    0.2%    0.2%
[       7.008727,        7.008731)    0    0.0%    0.2%
[       7.008731,        7.008754)    0    0.0%    0.2%
[       7.008754,        7.008871)    0    0.0%    0.2%
[       7.008871,        7.009486)    0    0.0%    0.2%
[       7.009486,        7.012717)    1    0.2%    0.3%
[       7.012717,        7.029681)    0    0.0%    0.3%
[       7.029681,        7.118752)    4    0.6%    0.9%
[       7.118752,        7.586433)  151   23.8%   24.8%  ##
[       7.586433,       10.042066)  476   75.1%   99.8%  ########
[      10.042066,             inf)    1    0.2%  100.0%

Unary-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1048576B-respSize_1B-Compressor_true:
50_Latency: 3.0332 ms 	90_Latency: 103.3904 ms 	99_Latency: 105.9662 ms 	Avg latency: 14.3660 ms 	Count: 353 10564536 Bytes/op	746 Allocs/op
Histogram (unit: ms)
Count: 353  Min:   2.4  Max: 108.0  Avg: 14.37
------------------------------------------------------------
[        2.387117,         2.387118)    1    0.3%    0.3%
[        2.387118,         2.387125)    0    0.0%    0.3%
[        2.387125,         2.387178)    0    0.0%    0.3%
[        2.387178,         2.387590)    0    0.0%    0.3%
[        2.387590,         2.390800)    1    0.3%    0.6%
[        2.390800,         2.415807)    0    0.0%    0.6%
[        2.415807,         2.610613)   18    5.1%    5.7%  #
[        2.610613,         4.128177)  275   77.9%   83.6%  ########
[        4.128177,        15.950202)   19    5.4%   89.0%  #
[       15.950202,       108.045341)   38   10.8%   99.7%  #
[      108.045341,              inf)    1    0.3%  100.0%

Stream-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1048576B-respSize_1B-Compressor_true:
50_Latency: 7.8843 ms 	90_Latency: 9.5418 ms 	99_Latency: 11.4460 ms 	Avg latency: 8.2069 ms 	Count: 610 	9331781 Bytes/op	202 Allocs/op
Histogram (unit: ms)
Count: 610  Min:   7.1  Max:  13.8  Avg: 8.21
------------------------------------------------------------
[       7.118476,        7.118477)    1    0.2%    0.2%
[       7.118477,        7.118482)    0    0.0%    0.2%
[       7.118482,        7.118509)    0    0.0%    0.2%
[       7.118509,        7.118664)    0    0.0%    0.2%
[       7.118664,        7.119557)    0    0.0%    0.2%
[       7.119557,        7.124672)    0    0.0%    0.2%
[       7.124672,        7.154003)    1    0.2%    0.3%
[       7.154003,        7.322174)   11    1.8%    2.1%
[       7.322174,        8.286399)  438   71.8%   73.9%  #######
[       8.286399,       13.814870)  158   25.9%   99.8%  ###
[      13.814870,             inf)    1    0.2%  100.0%

Unary-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1048576B-respSize_1048576B-Compressor_true:
50_Latency: 9.0261 ms 	90_Latency: 109.7679 ms 	99_Latency: 114.3220 ms 	Avg latency: 25.3790 ms 	Count: 198 21166524 Bytes/op	1146 Allocs/op
Histogram (unit: ms)
Count: 198  Min:   4.8  Max: 214.9  Avg: 25.38
------------------------------------------------------------
[        4.832406,         4.832407)    1    0.5%    0.5%
[        4.832407,         4.832414)    0    0.0%    0.5%
[        4.832414,         4.832477)    0    0.0%    0.5%
[        4.832477,         4.833000)    0    0.0%    0.5%
[        4.833000,         4.837405)    0    0.0%    0.5%
[        4.837405,         4.874438)    0    0.0%    0.5%
[        4.874438,         5.185826)    6    3.0%    3.5%
[        5.185826,         7.804113)   70   35.4%   38.9%  ####
[        7.804113,        29.819813)   89   44.9%   83.8%  ####
[       29.819813,       214.937387)   31   15.7%   99.5%  ##
[      214.937387,              inf)    1    0.5%  100.0%

Stream-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1048576B-respSize_1048576B-Compressor_true:
50_Latency: 18.3365 ms 	90_Latency: 20.9185 ms 	99_Latency: 22.9236 ms 	Avg latency: 18.5772 ms 	Count: 270 	16871341 Bytes/op	222 Allocs/op
Histogram (unit: ms)
Count: 270  Min:  14.6  Max:  25.7  Avg: 18.58
------------------------------------------------------------
[      14.633886,       14.633887)    1    0.4%    0.4%
[      14.633887,       14.633892)    0    0.0%    0.4%
[      14.633892,       14.633923)    0    0.0%    0.4%
[      14.633923,       14.634109)    0    0.0%    0.4%
[      14.634109,       14.635235)    0    0.0%    0.4%
[      14.635235,       14.642063)    0    0.0%    0.4%
[      14.642063,       14.683443)    2    0.7%    1.1%
[      14.683443,       14.934234)    5    1.9%    3.0%
[      14.934234,       16.454186)   24    8.9%   11.9%  #
[      16.454186,       25.666055)  237   87.8%   99.6%  #########
[      25.666055,             inf)    1    0.4%  100.0%

OpenCensus disabled

go run benchmark/benchmain/main.go -benchtime=5s -workloads=all \
  -compression=on -maxConcurrentCalls=1 -trace=off \
  -reqSizeBytes=1,1048576 -respSizeBytes=1,1048576 -networkMode=Local \
  -opencensus-server-stats=false -opencensus-server-trace=false
Unary-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1B-respSize_1B-Compressor_true:
50_Latency: 168.2190 µs 	90_Latency: 232.0810 µs 	99_Latency: 343.7810 µs 	Avg latency: 180.4180 µs 	Count: 27679 	14264 Bytes/op	231 Allocs/op
Histogram (unit: µs)
Count: 27679  Min: 107.2  Max: 784.8  Avg: 180.42
------------------------------------------------------------
[   107.219000,    107.220000)      1    0.0%    0.0%
[   107.220000,    107.223445)      0    0.0%    0.0%
[   107.223445,    107.238759)      0    0.0%    0.0%
[   107.238759,    107.306833)      1    0.0%    0.0%
[   107.306833,    107.609431)      2    0.0%    0.0%
[   107.609431,    108.954522)      1    0.0%    0.0%
[   108.954522,    114.933646)     38    0.1%    0.2%
[   114.933646,    141.511728)   2476    8.9%    9.1%  #
[   141.511728,    259.655172)  23999   86.7%   95.8%  #########
[   259.655172,    784.820000)   1160    4.2%  100.0%
[   784.820000,           inf)      1    0.0%  100.0%

Stream-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1B-respSize_1B-Compressor_true:
50_Latency: 269.7300 µs 	90_Latency: 650.3660 µs 	99_Latency: 802.7720 µs 	Avg latency: 357.5900 µs 	Count: 13973 	876308 Bytes/op	143 Allocs/op
Histogram (unit: µs)
Count: 13973  Min: 154.8  Max: 2543.4  Avg: 357.59
------------------------------------------------------------
[    154.842000,     154.843000)      1    0.0%    0.0%
[    154.843000,     154.847113)      0    0.0%    0.0%
[    154.847113,     154.868144)      0    0.0%    0.0%
[    154.868144,     154.975674)      0    0.0%    0.0%
[    154.975674,     155.525486)      0    0.0%    0.0%
[    155.525486,     158.336718)     17    0.1%    0.1%
[    158.336718,     172.710765)    552    4.0%    4.1%
[    172.710765,     246.206388)   5255   37.6%   41.7%  ####
[    246.206388,     621.995245)   6243   44.7%   86.4%  ####
[    621.995245,    2543.433000)   1904   13.6%  100.0%  #
[   2543.433000,            inf)      1    0.0%  100.0%

Unary-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1B-respSize_1048576B-Compressor_true:
50_Latency: 3.1750 ms 	90_Latency: 103.2195 ms 	99_Latency: 106.6226 ms 	Avg latency: 14.1156 ms 	Count: 358 10551755 Bytes/op	654 Allocs/op
Histogram (unit: ms)
Count: 358  Min:   2.5  Max: 109.5  Avg: 14.12
------------------------------------------------------------
[        2.483820,         2.483821)    1    0.3%    0.3%
[        2.483821,         2.483828)    0    0.0%    0.3%
[        2.483828,         2.483881)    0    0.0%    0.3%
[        2.483881,         2.484295)    0    0.0%    0.3%
[        2.484295,         2.487524)    0    0.0%    0.3%
[        2.487524,         2.512714)    0    0.0%    0.3%
[        2.512714,         2.709229)   14    3.9%    4.2%
[        2.709229,         4.242286)  243   67.9%   72.1%  #######
[        4.242286,        16.201980)   63   17.6%   89.7%  ##
[       16.201980,       109.502070)   36   10.1%   99.7%  #
[      109.502070,              inf)    1    0.3%  100.0%

Stream-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1B-respSize_1048576B-Compressor_true:
50_Latency: 8.0744 ms 	90_Latency: 9.6865 ms 	99_Latency: 11.9284 ms 	Avg latency: 8.3845 ms 	Count: 597 	9066419 Bytes/op	186 Allocs/op
Histogram (unit: ms)
Count: 597  Min:   7.3  Max:  14.5  Avg: 8.38
------------------------------------------------------------
[       7.254794,        7.254795)    1    0.2%    0.2%
[       7.254795,        7.254800)    0    0.0%    0.2%
[       7.254800,        7.254827)    0    0.0%    0.2%
[       7.254827,        7.254987)    0    0.0%    0.2%
[       7.254987,        7.255911)    0    0.0%    0.2%
[       7.255911,        7.261249)    0    0.0%    0.2%
[       7.261249,        7.292112)    2    0.3%    0.5%
[       7.292112,        7.470519)   27    4.5%    5.0%
[       7.470519,        8.501852)  390   65.3%   70.4%  #######
[       8.501852,       14.463755)  176   29.5%   99.8%  ###
[      14.463755,             inf)    1    0.2%  100.0%

Unary-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1048576B-respSize_1B-Compressor_true:
50_Latency: 3.0294 ms 	90_Latency: 103.3892 ms 	99_Latency: 105.5273 ms 	Avg latency: 14.3089 ms 	Count: 352 10551786 Bytes/op	671 Allocs/op
Histogram (unit: ms)
Count: 352  Min:   2.4  Max: 107.1  Avg: 14.31
------------------------------------------------------------
[        2.372767,         2.372768)    1    0.3%    0.3%
[        2.372768,         2.372775)    0    0.0%    0.3%
[        2.372775,         2.372828)    0    0.0%    0.3%
[        2.372828,         2.373238)    0    0.0%    0.3%
[        2.373238,         2.376436)    0    0.0%    0.3%
[        2.376436,         2.401318)    0    0.0%    0.3%
[        2.401318,         2.594969)    9    2.6%    2.8%
[        2.594969,         4.102076)  292   83.0%   85.8%  ########
[        4.102076,        15.831285)   11    3.1%   88.9%
[       15.831285,       107.115020)   38   10.8%   99.7%  #
[      107.115020,              inf)    1    0.3%  100.0%

Stream-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1048576B-respSize_1B-Compressor_true:
50_Latency: 7.7491 ms 	90_Latency: 8.5561 ms 	99_Latency: 10.6528 ms 	Avg latency: 7.9383 ms 	Count: 630 	9066222 Bytes/op	187 Allocs/op
Histogram (unit: ms)
Count: 630  Min:   7.1  Max:  12.9  Avg: 7.94
------------------------------------------------------------
[       7.143355,        7.143356)    1    0.2%    0.2%
[       7.143356,        7.143361)    0    0.0%    0.2%
[       7.143361,        7.143387)    0    0.0%    0.2%
[       7.143387,        7.143534)    0    0.0%    0.2%
[       7.143534,        7.144363)    0    0.0%    0.2%
[       7.144363,        7.149036)    0    0.0%    0.2%
[       7.149036,        7.175367)    0    0.0%    0.2%
[       7.175367,        7.323736)   17    2.7%    2.9%
[       7.323736,        8.159779)  486   77.1%   80.0%  ########
[       8.159779,       12.870781)  125   19.8%   99.8%  ##
[      12.870781,             inf)    1    0.2%  100.0%

Unary-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1048576B-respSize_1048576B-Compressor_true:
50_Latency: 5.5452 ms 	90_Latency: 106.8525 ms 	99_Latency: 108.9436 ms 	Avg latency: 22.8244 ms 	Count: 223 21088936 Bytes/op	1102 Allocs/op
Histogram (unit: ms)
Count: 223  Min:   4.8  Max: 210.2  Avg: 22.82
------------------------------------------------------------
[        4.804724,         4.804725)    1    0.4%    0.4%
[        4.804725,         4.804732)    0    0.0%    0.4%
[        4.804732,         4.804794)    0    0.0%    0.4%
[        4.804794,         4.805314)    0    0.0%    0.4%
[        4.805314,         4.809672)    1    0.4%    0.9%
[        4.809672,         4.846225)    1    0.4%    1.3%
[        4.846225,         5.152800)   27   12.1%   13.5%  #
[        5.152800,         7.724077)  158   70.9%   84.3%  #######
[        7.724077,        29.289660)    0    0.0%   84.3%
[       29.289660,       210.162588)   34   15.2%   99.6%  ##
[      210.162588,              inf)    1    0.4%  100.0%

Stream-traceMode_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_1048576B-respSize_1048576B-Compressor_true:
50_Latency: 14.9834 ms 	90_Latency: 15.7447 ms 	99_Latency: 16.6828 ms 	Avg latency: 15.0865 ms 	Count: 332 	16926380 Bytes/op	203 Allocs/op
Histogram (unit: ms)
Count: 332  Min:  14.0  Max:  17.4  Avg: 15.09
------------------------------------------------------------
[      14.022665,       14.022666)    1    0.3%    0.3%
[      14.022666,       14.022670)    0    0.0%    0.3%
[      14.022670,       14.022693)    0    0.0%    0.3%
[      14.022693,       14.022815)    0    0.0%    0.3%
[      14.022815,       14.023461)    0    0.0%    0.3%
[      14.023461,       14.026893)    0    0.0%    0.3%
[      14.026893,       14.045125)    0    0.0%    0.3%
[      14.045125,       14.141966)    0    0.0%    0.3%
[      14.141966,       14.656360)   55   16.6%   16.9%  ##
[      14.656360,       17.388676)  275   82.8%   99.7%  ########
[      17.388676,             inf)    1    0.3%  100.0%
Clone this wiki locally