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: 181.5370 µs 	90_Latency: 243.2850 µs 	99_Latency: 359.5190 µs 	Avg latency: 192.8910 µs 	Count: 25889 	14267 Bytes/op	231 Allocs/op
Histogram (unit: µs)
Count: 25889  Min: 109.9  Max: 1138.4  Avg: 192.89
------------------------------------------------------------
[    109.889000,     109.890000)      1    0.0%    0.0%
[    109.890000,     109.893656)      0    0.0%    0.0%
[    109.893656,     109.910679)      0    0.0%    0.0%
[    109.910679,     109.989942)      0    0.0%    0.0%
[    109.989942,     110.358998)      0    0.0%    0.0%
[    110.358998,     112.077365)      1    0.0%    0.0%
[    112.077365,     120.078287)     21    0.1%    0.1%
[    120.078287,     157.331522)   3587   13.9%   13.9%  #
[    157.331522,     330.786973)  21929   84.7%   98.6%  ########
[    330.786973,    1138.416000)    349    1.3%  100.0%
[   1138.416000,            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: 307.6790 µs 	90_Latency: 713.3110 µs 	99_Latency: 922.9510 µs 	Avg latency: 400.1770 µs 	Count: 12487 	921917 Bytes/op	144 Allocs/op
Histogram (unit: µs)
Count: 12487  Min: 161.2  Max: 1859.7  Avg: 400.18
------------------------------------------------------------
[    161.249000,     161.250000)      1    0.0%    0.0%
[    161.250000,     161.253923)      0    0.0%    0.0%
[    161.253923,     161.273236)      0    0.0%    0.0%
[    161.273236,     161.368312)      0    0.0%    0.0%
[    161.368312,     161.836372)      0    0.0%    0.0%
[    161.836372,     164.140625)      4    0.0%    0.0%
[    164.140625,     175.484423)    125    1.0%    1.0%
[    175.484423,     231.329757)   2550   20.4%   21.5%  ##
[    231.329757,     506.255424)   6153   49.3%   70.7%  #####
[    506.255424,    1859.710000)   3653   29.3%  100.0%  ###
[   1859.710000,            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.1945 ms 	90_Latency: 103.7455 ms 	99_Latency: 105.7277 ms 	Avg latency: 14.7148 ms 	Count: 344 10551403 Bytes/op	626 Allocs/op
Histogram (unit: ms)
Count: 344  Min:   2.7  Max: 306.7  Avg: 14.71
------------------------------------------------------------
[        2.689832,         2.689833)    1    0.3%    0.3%
[        2.689833,         2.689841)    0    0.0%    0.3%
[        2.689841,         2.689909)    0    0.0%    0.3%
[        2.689909,         2.690504)    0    0.0%    0.3%
[        2.690504,         2.695723)    0    0.0%    0.3%
[        2.695723,         2.741441)    1    0.3%    0.6%
[        2.741441,         3.141965)  137   39.8%   40.4%  ####
[        3.141965,         6.650882)  168   48.8%   89.2%  #####
[        6.650882,        37.391846)    0    0.0%   89.2%
[       37.391846,       306.707639)   36   10.5%   99.7%  #
[      306.707639,              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.9554 ms 	90_Latency: 10.8526 ms 	99_Latency: 12.1310 ms 	Avg latency: 8.5762 ms 	Count: 584 	9067361 Bytes/op	186 Allocs/op
Histogram (unit: ms)
Count: 584  Min:   7.3  Max:  14.0  Avg: 8.58
------------------------------------------------------------
[       7.340595,        7.340596)    1    0.2%    0.2%
[       7.340596,        7.340601)    0    0.0%    0.2%
[       7.340601,        7.340628)    0    0.0%    0.2%
[       7.340628,        7.340783)    0    0.0%    0.2%
[       7.340783,        7.341675)    0    0.0%    0.2%
[       7.341675,        7.346784)    1    0.2%    0.3%
[       7.346784,        7.376070)    3    0.5%    0.9%
[       7.376070,        7.543941)   45    7.7%    8.6%  #
[       7.543941,        8.506211)  365   62.5%   71.1%  ######
[       8.506211,       14.022109)  168   28.8%   99.8%  ###
[      14.022109,             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.2877 ms 	90_Latency: 103.6535 ms 	99_Latency: 107.7612 ms 	Avg latency: 14.6920 ms 	Count: 346 10551741 Bytes/op	668 Allocs/op
Histogram (unit: ms)
Count: 346  Min:   2.6  Max: 109.9  Avg: 14.69
------------------------------------------------------------
[        2.589699,         2.589700)    1    0.3%    0.3%
[        2.589700,         2.589707)    0    0.0%    0.3%
[        2.589707,         2.589760)    0    0.0%    0.3%
[        2.589760,         2.590174)    0    0.0%    0.3%
[        2.590174,         2.593408)    0    0.0%    0.3%
[        2.593408,         2.618643)    0    0.0%    0.3%
[        2.618643,         2.815579)   12    3.5%    3.8%
[        2.815579,         4.352447)  256   74.0%   77.7%  #######
[        4.352447,        16.346044)   39   11.3%   89.0%  #
[       16.346044,       109.943129)   37   10.7%   99.7%  #
[      109.943129,              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.8898 ms 	90_Latency: 8.5260 ms 	99_Latency: 10.1791 ms 	Avg latency: 8.0128 ms 	Count: 624 	9066673 Bytes/op	187 Allocs/op
Histogram (unit: ms)
Count: 624  Min:   7.2  Max:  14.1  Avg: 8.01
------------------------------------------------------------
[       7.202124,        7.202125)    1    0.2%    0.2%
[       7.202125,        7.202130)    0    0.0%    0.2%
[       7.202130,        7.202157)    0    0.0%    0.2%
[       7.202157,        7.202314)    0    0.0%    0.2%
[       7.202314,        7.203219)    0    0.0%    0.2%
[       7.203219,        7.208426)    0    0.0%    0.2%
[       7.208426,        7.238380)    0    0.0%    0.2%
[       7.238380,        7.410707)   19    3.0%    3.2%
[       7.410707,        8.402108)  522   83.7%   86.9%  ########
[       8.402108,       14.105673)   81   13.0%   99.8%  #
[      14.105673,             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.7130 ms 	90_Latency: 107.0064 ms 	99_Latency: 108.3813 ms 	Avg latency: 24.7611 ms 	Count: 202 21119693 Bytes/op	1065 Allocs/op
Histogram (unit: ms)
Count: 202  Min:   5.0  Max: 208.9  Avg: 24.76
------------------------------------------------------------
[        4.956228,         4.956229)    1    0.5%    0.5%
[        4.956229,         4.956236)    0    0.0%    0.5%
[        4.956236,         4.956298)    0    0.0%    0.5%
[        4.956298,         4.956817)    0    0.0%    0.5%
[        4.956817,         4.961161)    1    0.5%    1.0%
[        4.961161,         4.997569)    1    0.5%    1.5%
[        4.997569,         5.302688)   22   10.9%   12.4%  #
[        5.302688,         7.859773)  139   68.8%   81.2%  #######
[        7.859773,        29.289695)    1    0.5%   81.7%
[       29.289695,       208.885465)   36   17.8%   99.5%  ##
[      208.885465,              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: 14.8592 ms 	90_Latency: 15.4837 ms 	99_Latency: 16.5589 ms 	Avg latency: 14.9433 ms 	Count: 335 	17022431 Bytes/op	203 Allocs/op
Histogram (unit: ms)
Count: 335  Min:  14.3  Max:  16.7  Avg: 14.94
------------------------------------------------------------
[      14.259569,       14.259570)    1    0.3%    0.3%
[      14.259570,       14.259574)    0    0.0%    0.3%
[      14.259574,       14.259595)    0    0.0%    0.3%
[      14.259595,       14.259705)    0    0.0%    0.3%
[      14.259705,       14.260265)    0    0.0%    0.3%
[      14.260265,       14.263144)    0    0.0%    0.3%
[      14.263144,       14.277933)    0    0.0%    0.3%
[      14.277933,       14.353896)    2    0.6%    0.9%
[      14.353896,       14.744075)  118   35.2%   36.1%  ####
[      14.744075,       16.748204)  213   63.6%   99.7%  ######
[      16.748204,             inf)    1    0.3%  100.0%
Clone this wiki locally