/
runbenchmarks.sh
executable file
·139 lines (112 loc) · 4.45 KB
/
runbenchmarks.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/usr/bin/env bash
# Set MULTIPLIER to 1 for quick results and to 100 for more stable results.
MULTIPLIER=50
echo ====================================================================================
echo Legend:
echo "OTLP/GRPC-Unary/Sequential - OTLP/gRPC Official. Unary, sequential. One request per batch, load balancer friendly, with ack"
echo "OTLP/GRPC-Unary/Concurrent - OTLP/gRPC Official. Unary, N concurrent requests, load balancer friendly, with ack"
echo "OTLP/HTTP1.1/N - OTLP/HTTP Official. Using HTTP 1.1. N concurrent requests. Load balancer friendly."
echo "GRPC/Stream/LBTimed/Sync - OTLP ProtoBuf over GRPC, streaming, load balancer friendly, close stream every 30 sec, with ack"
echo "GRPC/Stream/LBTimed/Async/N - OTLP ProtoBuf over GRPC, streaming. N streams, load balancer friendly, close stream every 30 sec, with async ack"
echo "GRPC/OpenCensus - OpenCensus protocol, streaming, not load balancer friendly, without ack"
echo "GRPC/OpenCensusWithAck - OpenCensus-like protocol, streaming, not load balancer friendly, with ack"
echo "GRPC/Stream/NoLB - OTLP ProtoBuf over GRPC, streaming, not load balancer friendly, with ack"
echo "GRPC/Stream/LBAlways/Sync - OTLP ProtoBuf over GRPC, streaming, load balancer friendly, close stream after every batch, with ack"
echo "GRPC/Stream/LBSrv/Async - OTLP ProtoBuf over GRPC Streaming. Load balancer friendly, server closes stream every 30 sec or 1000 batches, with async ack"
echo "WebSocket/Stream/Sync - OTLP ProtoBuf over WebSocket, streaming, unknown load balancer friendliness, with sync ack"
echo "WebSocket/Stream/Async/N - OTLP ProtoBuf over WebSocket, N streams, unknown load balancer friendliness, with async ack"
echo "WebSocket/Stream/Async/zlib - OTLP ProtoBuf over WebSocket, streaming, unknown load balancer friendliness, with async ack, zlib compression"
echo "SAPM/N - SAPM, N concurrent requests. Load balancer friendly."
echo
benchmark() {
nice -n -5 ./benchmark -protocol $1 -batches=${BATCHES} -spansperbatch=${SPANSPERBATCH} -attrperspan=${ATTRPERSPAN} -cpuprofile $1.prof
}
benchmark_all() {
echo ${BATCHES} $1 batches, ${SPANSPERBATCH} spans per batch, ${ATTRPERSPAN} attrs per span
#benchmark sapm
benchmark http11
# benchmark http11conc
# benchmark wsasyncworker
# benchmark wsasyncworkerconc
# benchmark wsstreamasync
# benchmark wsstreamasyncconc
# benchmark wsstreamsync
#benchmark wsstreamasynczlib
benchmark unary
# benchmark unaryasync
# benchmark streamlbasync
# benchmark streamlbconc
#benchmark opencensus
#benchmark ocack
#benchmark streamsync
#benchmark streamlbalwayssync
#benchmark streamlbtimedsync
#benchmark streamlbsrv
echo
}
benchmark_all_latency() {
let roundtrip=$1*2
echo ${roundtrip}ms network roundtrip latency
tc qdisc add dev lo root netem delay ${1}ms
benchmark_all large
#tc qdisc delete dev lo root netem delay ${1}ms
}
benchmark_some_latency() {
echo 200ms network roundtrip latency
echo ${BATCHES} large batches, ${SPANSPERBATCH} spans per batch, ${ATTRPERSPAN} attrs per span
tc qdisc add dev lo root netem delay 100ms
benchmark http11conc
benchmark wsasyncworker
benchmark wsasyncworkerconc
#benchmark unaryasync
#benchmark opencensus
benchmark streamlbasync
benchmark streamlbconc
benchmark wsstreamasync
benchmark wsstreamasyncconc
#benchmark wsstreamasynczlib
#tc qdisc delete dev lo root netem delay 100ms
}
#./beforebenchmarks.sh
#tc qdisc delete dev lo root netem delay 100ms > /dev/null 2>&1
echo
cd bin
let BATCHES=6400*MULTIPLIER
SPANSPERBATCH=1
ATTRPERSPAN=10
benchmark_all nano
let BATCHES=1600*MULTIPLIER
SPANSPERBATCH=10
ATTRPERSPAN=10
benchmark_all tiny
let BATCHES=800*MULTIPLIER
SPANSPERBATCH=100
ATTRPERSPAN=10
benchmark_all small
let BATCHES=80*MULTIPLIER
SPANSPERBATCH=500
ATTRPERSPAN=10
benchmark_all large
let BATCHES=10*MULTIPLIER
SPANSPERBATCH=1000
ATTRPERSPAN=10
benchmark_all "very large"
let BATCHES=80*MULTIPLIER
SPANSPERBATCH=500
ATTRPERSPAN=10
benchmark_all_latency 1
let BATCHES=40*MULTIPLIER
SPANSPERBATCH=500
ATTRPERSPAN=10
benchmark_all_latency 10
let BATCHES=4*MULTIPLIER
SPANSPERBATCH=500
ATTRPERSPAN=10
benchmark_all_latency 100
let BATCHES=4*MULTIPLIER*10
SPANSPERBATCH=500
ATTRPERSPAN=10
benchmark_some_latency
echo ====================================================================================
cd ..
#./afterbenchmarks.sh