Benchmarking Nginx and Apache Static File Performance on Windows
(nginx 1.27.5 vs apache 2.4.63, hey load testing, includes raw data and analysis)
Background & Motivation
The vast majority of Nginx and Apache performance evaluations are conducted on Linux. The Nginx official documentation has clearly stated that its Windows release is always in beta, and high performance and scalability should not be expected. In practice, real-world high concurrency benchmarks for Nginx on Windows are extremely rare.
This article uses the hey load testing tool to measure and compare the high-concurrency static file performance of Nginx 1.27.5 and Apache 2.4.63 on a Tencent Cloud lightweight instance (2 cores, 2.6GHz, 2GB RAM, Windows), filling this gap.
Test Environment
- Server: Tencent Cloud Lightweight Server, 2 cores @ 2.6GHz, 2GB RAM
- Operating System: Windows
- Nginx Version: 1.27.5
- Apache Version: 2.4.63
- Static Resource: Local static image
/static/tomato.png
(71,882 bytes per request)
- Load Tool: hey for Windows
- Load Parameters: 400 concurrent connections, 30,000 total requests
- Test Command:
hey_windows_amd64.exe -c 400 -n 30000 http://127.0.0.1/static/tomato.png
Raw Test Data
Apache 2.4.63 Test Results
Summary:
Total: 19.2283 secs
Slowest: 18.6432 secs
Fastest: 0.0004 secs
Average: 0.1415 secs
Requests/sec: 1560.2004
Total data: 2156460000 bytes
Size/request: 71882 bytes
Response time histogram:
0.000 [1] |
1.865 [29746] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
3.729 [1] |
5.593 [5] |
7.458 [0] |
9.322 [19] |
11.186 [132] |
13.050 [3] |
14.915 [39] |
16.779 [4] |
18.643 [50] |
Latency distribution:
10% in 0.0011 secs
25% in 0.0046 secs
50% in 0.0328 secs
75% in 0.0552 secs
90% in 0.0774 secs
95% in 0.1396 secs
99% in 0.4220 secs
Details (average, fastest, slowest):
DNS+dialup: 0.0008 secs, 0.0004 secs, 18.6432 secs
DNS-lookup: 0.0000 secs, 0.0000 secs, 0.0000 secs
req write: 0.0003 secs, 0.0000 secs, 0.3439 secs
resp wait: 0.1348 secs, 0.0004 secs, 18.6431 secs
resp read: 0.0046 secs, 0.0000 secs, 0.3162 secs
Status code distribution:
[200] 30000 responses
Nginx 1.27.5 Test Results
Summary:
Total: 14.0290 secs
Slowest: 0.3516 secs
Fastest: 0.1592 secs
Average: 0.1808 secs
Requests/sec: 2138.4308
Total data: 2156460000 bytes
Size/request: 71882 bytes
Response time histogram:
0.159 [1] |
0.178 [15472] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
0.198 [12350] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
0.217 [1556] |■■■■
0.236 [394] |■
0.255 [122] |
0.275 [61] |
0.294 [6] |
0.313 [1] |
0.332 [19] |
0.352 [18] |
Latency distribution:
10% in 0.1678 secs
25% in 0.1715 secs
50% in 0.1779 secs
75% in 0.1859 secs
90% in 0.1934 secs
95% in 0.2082 secs
99% in 0.2329 secs
Details (average, fastest, slowest):
DNS+dialup: 0.0007 secs, 0.1592 secs, 0.3516 secs
DNS-lookup: 0.0000 secs, 0.0000 secs, 0.0000 secs
req write: 0.0001 secs, 0.0000 secs, 0.0522 secs
resp wait: 0.0180 secs, 0.0003 secs, 0.0890 secs
resp read: 0.1619 secs, 0.0831 secs, 0.2194 secs
Status code distribution:
[200] 30000 responses
Metrics Comparison & Analysis
Metric |
Apache 2.4.63 |
Nginx 1.27.5 |
Total Time |
19.23 s |
14.03 s |
Average Latency |
0.142 s |
0.181 s |
QPS (Throughput) |
1560 r/s |
2138 r/s |
Slowest |
18.64 s |
0.35 s |
Fastest |
0.0004 s |
0.1592 s |
90% Under |
0.077 s |
0.193 s |
Status 200 |
30,000 |
30,000 |
Errors |
0 |
0 |
Key Findings
- Higher Throughput: Nginx achieved 2138 QPS, 37% higher than Apache (possibly due to its more uniform response time).
- Long-tail Responses: Apache had a few extremely slow requests, which increased the maximum latency. In contrast, Nginx’s response time distribution was extremely tight and showed no significant long-tail delays.
- Response Time Distribution:
- With Apache, nearly all requests were extremely quick (99% under 0.42s), but there were some outliers (>10s, likely due to process/thread pool or IO contention).
- With Nginx, almost all responses were concentrated between 0.16 and 0.23s—very consistent, with very few outliers.
- Stability: Both servers processed all requests without errors in this round of testing.
Confirming Nginx's Official "Windows High Performance and Scalability Should Not Be Expected" Statement
- Nginx official documentation: “high performance and scalability should not be expected, version of nginx for Windows is considered to be a beta version.”
- This benchmark demonstrates that, for short-duration high-concurrency static file workloads, Nginx performed surprisingly well—even surpassing Apache in throughput—with more uniform response times.
This article further conducts cross-validation using both ab and hey testing tools, arriving at consistent conclusions.
c:\Apache24\bin>ab.exe -c 400 -n 30000 http://127.0.0.1/static/tomato.png
This is ApacheBench, Version 2.3 <$Revision: 1923142 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 3000 requests
Completed 6000 requests
...
Completed 30000 requests
Finished 30000 requests
Server Software: nginx/1.27.5
Server Hostname: 127.0.0.1
Server Port: 80
Document Path: /static/tomato.png
Document Length: 71882 bytes
Concurrency Level: 400
Time taken for tests: 13.537 seconds
Complete requests: 30000
Failed requests: 0
Total transferred: 2163570000 bytes
HTML transferred: 2156460000 bytes
Requests per second: 2216.11 [#/sec] (mean)
Time per request: 180.496 [ms] (mean)
Time per request: 0.451 [ms] (mean, across all concurrent requests)
Transfer rate: 156078.10 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.4 0 16
Processing: 160 179 11.0 174 253
Waiting: 0 6 10.0 0 80
Total: 160 179 11.1 174 253
Percentage of the requests served within a certain time (ms)
50% 174
66% 177
75% 183
80% 188
90% 189
95% 194
98% 218
99% 231
100% 253 (longest request)
c:\Apache24\bin>ab.exe -c 400 -n 30000 http://127.0.0.1/static/tomato.png
This is ApacheBench, Version 2.3 <$Revision: 1923142 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 3000 requests
Completed 6000 requests
...
Completed 30000 requests
Finished 30000 requests
Server Software: Apache/2.4.63
Server Hostname: 127.0.0.1
Server Port: 80
Document Path: /static/tomato.png
Document Length: 71882 bytes
Concurrency Level: 400
Time taken for tests: 18.277 seconds
Complete requests: 30000
Failed requests: 0
Total transferred: 2171160000 bytes
HTML transferred: 2156460000 bytes
Requests per second: 1641.42 [#/sec] (mean)
Time per request: 243.691 [ms] (mean)
Time per request: 0.609 [ms] (mean, across all concurrent requests)
Transfer rate: 116008.67 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.5 0 35
Processing: 51 242 54.0 222 878
Waiting: 16 230 61.9 211 878
Total: 51 243 54.0 222 878
Percentage of the requests served within a certain time (ms)
50% 222
66% 250
75% 268
80% 282
90% 330
95% 348
98% 372
99% 408
100% 878 (longest request)