|
1 | 1 | # Nighthawk |
2 | 2 |
|
3 | | -*A L7 HTTP protocol family benchmarking tool based on Envoy* |
| 3 | +*A L7 (HTTP/HTTPS/HTTP2) performance characterization tool* |
4 | 4 |
|
5 | 5 | ## Current state |
6 | 6 |
|
7 | | -The nighthawk client supports HTTP/1.1 and HTTP/2 over HTTP and HTTPS. |
| 7 | +Nighthawk currently offers: |
| 8 | + |
| 9 | +- A load testing client which supports HTTP/1.1 and HTTP/2 over HTTP and HTTPS. |
| 10 | +(HTTPS certificates are not yet validated). |
| 11 | +- A simple [test server](source/server/README.md) which is capable of generating dynamic response sizes, as well as inject delays. |
8 | 12 |
|
9 | | -HTTPS certificates are not yet validated. |
10 | 13 |
|
11 | 14 | ## Prerequisites |
12 | 15 |
|
13 | 16 | ### Ubuntu |
14 | 17 |
|
15 | 18 | First, follow steps 1 and 2 over at [Quick start Bazel build for developers](https://github.com/envoyproxy/envoy/blob/master/bazel/README.md#quick-start-bazel-build-for-developers). |
16 | 19 |
|
17 | | -## Building and testing Nighthawk |
| 20 | + |
| 21 | +## Building and using the Nighthawk client CLI |
| 22 | + |
| 23 | +For building the Nighthawk test server, see [here](source/server/README.md). |
| 24 | + |
| 25 | +### Test it |
18 | 26 |
|
19 | 27 | ```bash |
20 | | -# test it |
21 | 28 | bazel test -c dbg //test:nighthawk_test |
22 | 29 | ``` |
23 | 30 |
|
24 | 31 | ### Build it |
25 | 32 |
|
26 | 33 | ```bash |
27 | | -# for best accuracy it is important to specify -c opt. |
28 | 34 | bazel build -c opt //:nighthawk_client |
29 | 35 | ``` |
30 | 36 |
|
31 | | -### Using the Nighthawk client |
| 37 | +### Using the CLI |
32 | 38 |
|
33 | 39 | ```bash |
34 | 40 | ➜ bazel-bin/nighthawk_client --help |
@@ -122,76 +128,84 @@ Where: |
122 | 128 | in case of https no certificates are validated. |
123 | 129 |
|
124 | 130 |
|
125 | | - Nighthawk, a L7 HTTP protocol family benchmarking tool based on Envoy. |
| 131 | + Nighthawk, a L7 (HTTP/HTTPS/HTTP2) performance characterization tool. |
126 | 132 |
|
127 | 133 |
|
128 | 134 | ``` |
129 | 135 |
|
130 | | -## Sample benchmark run |
| 136 | +## A sample benchmark run |
131 | 137 |
|
132 | 138 | ```bash |
133 | | -# start the benchmark target (Envoy in this case) on core 3. |
134 | | -$ taskset -c 3 /path/to/envoy --config-path nighthawk/tools/envoy.yaml |
135 | | - |
136 | | -# run a quick benchmark using cpu cores 4 and 5. |
137 | | -$ taskset -c 4-5 bazel-bin/nighthawk_client --rps 1000 --concurrency auto http://127.0.0.1:10000/ |
138 | | - |
| 139 | +# start the benchmark target (Envoy with a single worker in this case) on cpu-core 3. |
| 140 | +➜ taskset -c 3 envoy --concurrency 1 --config-path ~/envoy.yaml |
| 141 | + |
| 142 | +# run a quick benchmark using cpu-cores 4 and 5. |
| 143 | +➜ taskset -c 4-5 bazel-bin/nighthawk_client --rps 1000 --connections 4 --concurrency auto --prefetch-connections -v info http://127.0.0.1:10000/ |
| 144 | +[21:28:12.690578][27849][I] [source/client/client.cc:71] Detected 2 (v)CPUs with affinity.. |
| 145 | +[21:28:12.690621][27849][I] [source/client/client.cc:75] Starting 2 threads / event loops. Test duration: 5 seconds. |
| 146 | +[21:28:12.690627][27849][I] [source/client/client.cc:77] Global targets: 8 connections and 2000 calls per second. |
| 147 | +[21:28:12.690632][27849][I] [source/client/client.cc:81] (Per-worker targets: 4 connections and 1000 calls per second) |
139 | 148 | Nighthawk - A layer 7 protocol benchmarking tool. |
140 | 149 |
|
141 | | -benchmark_http_client.queue_to_connect: 9993 samples, mean: 0.000010053s, pstdev: 0.000011278s |
142 | | -Percentile Count Latency |
143 | | -0 1 0.000006713s |
144 | | -0.5 4997 0.000007821s |
145 | | -0.75 7495 0.000008677s |
146 | | -0.8 7995 0.000009084s |
147 | | -0.9 8994 0.000011583s |
148 | | -0.95 9494 0.000015702s |
149 | | -0.990625 9900 0.000077299s |
150 | | -0.999023 9984 0.000145863s |
151 | | -1 9993 0.000232383s |
152 | | - |
153 | | -benchmark_http_client.request_to_response: 9993 samples, mean: 0.000115456s, pstdev: 0.000052326s |
154 | | -Percentile Count Latency |
155 | | -0 1 0.000080279s |
156 | | -0.5 4998 0.000104799s |
157 | | -0.75 7496 0.000113787s |
158 | | -0.8 7996 0.000121359s |
159 | | -0.9 8994 0.000153487s |
160 | | -0.95 9494 0.000180647s |
161 | | -0.990625 9900 0.000382591s |
162 | | -0.999023 9984 0.000608159s |
163 | | -1 9993 0.000985951s |
164 | | - |
165 | | -sequencer.blocking: 14 samples, mean: 0.000531127s, pstdev: 0.000070919s |
166 | | -Percentile Count Latency |
167 | | -0 1 0.000484127s |
168 | | -0.5 7 0.000495615s |
169 | | -0.75 11 0.000521007s |
170 | | -0.8 12 0.000545887s |
171 | | -0.9 13 0.000655839s |
172 | | -1 14 0.000736223s |
173 | | - |
174 | | -sequencer.callback: 9993 samples, mean: 0.000131079s, pstdev: 0.000060199s |
175 | | -Percentile Count Latency |
176 | | -0 1 0.000091547s |
177 | | -0.5 4998 0.000116935s |
178 | | -0.75 7495 0.000127351s |
179 | | -0.8 7995 0.000137807s |
180 | | -0.9 8994 0.000174335s |
181 | | -0.95 9495 0.000210063s |
182 | | -0.990625 9900 0.000444063s |
183 | | -0.999023 9984 0.000664383s |
184 | | -1 9993 0.001103615s |
| 150 | +Queueing and connection setup latency |
| 151 | + samples: 9992 |
| 152 | + mean: 0s 000ms 002us |
| 153 | + pstdev: 0s 000ms 000us |
| 154 | + |
| 155 | + Percentile Count Latency |
| 156 | + 0 1 0s 000ms 001us |
| 157 | + 0.5 5013 0s 000ms 002us |
| 158 | + 0.75 7496 0s 000ms 002us |
| 159 | + 0.8 8008 0s 000ms 002us |
| 160 | + 0.9 8996 0s 000ms 002us |
| 161 | + 0.95 9493 0s 000ms 002us |
| 162 | + 0.990625 9899 0s 000ms 003us |
| 163 | + 0.999023 9983 0s 000ms 004us |
| 164 | + 1 9992 0s 000ms 027us |
| 165 | + |
| 166 | +Request start to response end |
| 167 | + samples: 9992 |
| 168 | + mean: 0s 000ms 108us |
| 169 | + pstdev: 0s 000ms 061us |
| 170 | + |
| 171 | + Percentile Count Latency |
| 172 | + 0 1 0s 000ms 073us |
| 173 | + 0.5 4997 0s 000ms 111us |
| 174 | + 0.75 7495 0s 000ms 113us |
| 175 | + 0.8 7997 0s 000ms 114us |
| 176 | + 0.9 8993 0s 000ms 116us |
| 177 | + 0.95 9493 0s 000ms 120us |
| 178 | + 0.990625 9899 0s 000ms 130us |
| 179 | + 0.999023 9983 0s 000ms 528us |
| 180 | + 1 9992 0s 004ms 083us |
| 181 | + |
| 182 | +Initiation to completion |
| 183 | + samples: 9992 |
| 184 | + mean: 0s 000ms 113us |
| 185 | + pstdev: 0s 000ms 061us |
| 186 | + |
| 187 | + Percentile Count Latency |
| 188 | + 0 1 0s 000ms 077us |
| 189 | + 0.5 4996 0s 000ms 115us |
| 190 | + 0.75 7495 0s 000ms 118us |
| 191 | + 0.8 7998 0s 000ms 118us |
| 192 | + 0.9 8993 0s 000ms 121us |
| 193 | + 0.95 9493 0s 000ms 124us |
| 194 | + 0.990625 9899 0s 000ms 135us |
| 195 | + 0.999023 9983 0s 000ms 588us |
| 196 | + 1 9992 0s 004ms 090us |
185 | 197 |
|
186 | 198 | Counter Value Per second |
187 | | -client.benchmark.http_2xx 9995 1999.00 |
188 | | -client.upstream_cx_close_notify 98 19.60 |
189 | | -client.upstream_cx_http1_total 100 20.00 |
190 | | -client.upstream_cx_rx_bytes_total 8585215 1717043.00 |
191 | | -client.upstream_cx_total 100 20.00 |
192 | | -client.upstream_cx_tx_bytes_total 569715 113943.00 |
193 | | -client.upstream_rq_pending_total 100 20.00 |
194 | | -client.upstream_rq_total 9995 1999.00 |
| 199 | +client.benchmark.http_2xx 9994 1998.80 |
| 200 | +client.upstream_cx_http1_total 8 1.60 |
| 201 | +client.upstream_cx_overflow 2 0.40 |
| 202 | +client.upstream_cx_rx_bytes_total 36008382 7201676.40 |
| 203 | +client.upstream_cx_total 8 1.60 |
| 204 | +client.upstream_cx_tx_bytes_total 599640 119928.00 |
| 205 | +client.upstream_rq_pending_total 2 0.40 |
| 206 | +client.upstream_rq_total 9994 1998.80 |
| 207 | + |
| 208 | +[21:28:18.522403][27849][I] [source/client/client.cc:279] Done. |
195 | 209 | ``` |
196 | 210 |
|
197 | 211 | ## Accuracy and repeatability considerations when using the Nighthawk client |
|
0 commit comments