Performance Testing
Performance testing is a complex process that depends on various scenarios. Below are some simple test scenarios.
CPU: M2
Nginx (No Access Logging)
Nginx is used here for comparison purposes
wrk 'http://127.0.0.1:9080/' --latency
Running 10s test @ http://127.0.0.1:9080/
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 393.55us 2.39ms 32.81ms 97.72%
Req/Sec 72.68k 5.98k 86.25k 87.13%
Latency Distribution
50% 65.00us
75% 71.00us
90% 78.00us
99% 14.87ms
1460643 requests in 10.10s, 208.95MB read
Requests/sec: 144598.99
Transfer/sec: 20.69MB
Pingap (No Access Logging)
wrk 'http://127.0.0.1:6188/ping' --latency
Running 10s test @ http://127.0.0.1:6188/ping
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 66.18us 28.39us 2.30ms 85.24%
Req/Sec 74.43k 1.75k 76.25k 97.03%
Latency Distribution
50% 70.00us
75% 77.00us
90% 83.00us
99% 100.00us
1495363 requests in 10.10s, 195.37MB read
Requests/sec: 148056.28
Transfer/sec: 19.34MB
Pingap Forwarding to Nginx
Threads: 1
wrk 'http://127.0.0.1:6188/proxy-nginx' --latency
Running 10s test @ http://127.0.0.1:6188/proxy-nginx
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 206.46us 151.03us 7.28ms 98.62%
Req/Sec 25.06k 1.16k 29.07k 87.13%
Latency Distribution
50% 211.00us
75% 224.00us
90% 239.00us
99% 391.00us
503591 requests in 10.10s, 72.04MB read
Requests/sec: 49862.65
Transfer/sec: 7.13MB
Threads: 2
wrk 'http://127.0.0.1:6188/proxy-nginx' --latency
Running 10s test @ http://127.0.0.1:6188/proxy-nginx
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 161.04us 753.69us 19.29ms 99.23%
Req/Sec 44.96k 2.73k 48.65k 73.76%
Latency Distribution
50% 107.00us
75% 125.00us
90% 143.00us
99% 299.00us
903504 requests in 10.10s, 129.25MB read
Requests/sec: 89449.37
Transfer/sec: 12.80MB
Threads: 3 (Setting to 3 threads shows little improvement over 2 threads, likely due to global locks or similar factors - to be confirmed later)
wrk 'http://127.0.0.1:6188/proxy-nginx' --latency
Running 10s test @ http://127.0.0.1:6188/proxy-nginx
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 111.73us 277.33us 10.84ms 99.54%
Req/Sec 48.06k 3.35k 74.58k 87.56%
Latency Distribution
50% 95.00us
75% 115.00us
90% 134.00us
99% 193.00us
961184 requests in 10.10s, 137.50MB read
Requests/sec: 95160.18
Transfer/sec: 13.61MB
Pingap Serving 8kb HTML
wrk 'http://127.0.0.1:6188/downloads/index.html' --latency
Running 10s test @ http://127.0.0.1:6188/downloads/index.html
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 225.84us 59.47us 1.83ms 78.04%
Req/Sec 22.17k 1.94k 25.25k 87.13%
Latency Distribution
50% 222.00us
75% 247.00us
90% 286.00us
99% 418.00us
445764 requests in 10.10s, 3.16GB read
Requests/sec: 44134.06
Transfer/sec: 320.01MB
Compression
Testing client compression performance with different compression formats (data is read from memory, so the main time cost is in compression processing). All compression algorithms are set to level 9; adjust as needed in actual use.
Client without compression support (24KB response data)
wrk 'http://localhost:6118/' --latency
Running 10s test @ http://localhost:6118/
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 110.61us 62.30us 3.71ms 87.06%
Req/Sec 44.96k 1.13k 46.16k 93.07%
Latency Distribution
50% 117.00us
75% 125.00us
90% 133.00us
99% 164.00us
903688 requests in 10.10s, 22.26GB read
Requests/sec: 89474.79
Transfer/sec: 2.20GB
Client with gzip compression support (2.87KB response data)
wrk -H "accept-encoding: gzip" 'http://localhost:6118/' --latency
Running 10s test @ http://localhost:6118/
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.59ms 525.65us 7.55ms 86.09%
Req/Sec 3.16k 156.64 3.36k 93.56%
Latency Distribution
50% 1.72ms
75% 1.80ms
90% 1.88ms
99% 2.25ms
63484 requests in 10.10s, 182.42MB read
Requests/sec: 6285.12
Transfer/sec: 18.06MB
Client with br compression support (2.46KB response data)
wrk -H "accept-encoding: br" 'http://localhost:6118/' --latency
Running 10s test @ http://localhost:6118/
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 16.62ms 5.41ms 54.96ms 88.28%
Req/Sec 302.12 24.46 353.00 83.00%
Latency Distribution
50% 18.03ms
75% 18.61ms
90% 19.47ms
99% 21.99ms
6023 requests in 10.01s, 14.85MB read
Requests/sec: 601.55
Transfer/sec: 1.48MB
Client with zstd compression support (2.73KB response data)
wrk -H "accept-encoding: zstd" 'http://localhost:6118/' --latency
Running 10s test @ http://localhost:6118/
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 2.19ms 0.93ms 23.19ms 85.73%
Req/Sec 2.32k 169.74 2.50k 92.50%
Latency Distribution
50% 2.32ms
75% 2.46ms
90% 2.59ms
99% 3.53ms
46183 requests in 10.01s, 126.27MB read
Requests/sec: 4612.25
Transfer/sec: 12.61MB
Client with zstd compression, server set to 2 threads
wrk -H "accept-encoding: zstd" 'http://localhost:6118/' --latency
Running 10s test @ http://localhost:6118/
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.33ms 540.17us 9.68ms 69.88%
Req/Sec 3.79k 201.55 4.21k 77.72%
Latency Distribution
50% 1.30ms
75% 1.72ms
90% 1.97ms
99% 2.47ms
76162 requests in 10.10s, 208.24MB read
Requests/sec: 7540.73
Transfer/sec: 20.62MB
Caching
Threads: 1
wrk -H 'Accept-Encoding: gzip, deflate, br, zstd' 'http://localhost:6118/cache'
Running 10s test @ http://localhost:6118/cache
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 183.82us 62.06us 2.30ms 86.60%
Req/Sec 27.27k 554.92 28.68k 92.57%
548062 requests in 10.10s, 2.07GB read
Requests/sec: 54263.03
Transfer/sec: 209.89MB
Threads: 2
wrk -H 'Accept-Encoding: gzip, deflate, br, zstd' 'http://localhost:6118/cache'
Running 10s test @ http://localhost:6118/cache
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 98.40us 47.66us 2.52ms 79.75%
Req/Sec 50.40k 4.23k 53.03k 91.58%
1013154 requests in 10.10s, 3.83GB read
Requests/sec: 100318.26
Transfer/sec: 388.01MB