- Benchmark
- HelloWorld
Benchmark
Yichun Zhang , 21 Jun 2011 (created 21 Jun 2011)
HelloWorld
Testing the performance of a HelloWorld server does not mean many things but it does tell us where the ceiling is.
The HelloWorld server based on OpenResty is described in the GettingStarted document.
Below is the result using the command ab -c10 -n50000 http://localhost:8080/ on my ThinkPad T400 laptop with ngx_openresty 0.8.54.6:
1. Server Software: ngx_openresty/0.8.54
2. Server Hostname: localhost
3. Server Port: 8080
4. 5. Document Path: /
6. Document Length: 20 bytes
7. 8. Concurrency Level: 10
9. Time taken for tests: 2.459 seconds
10. Complete requests: 50000
11. Failed requests: 0
12. Write errors: 0
13. Total transferred: 8550342 bytes
14. HTML transferred: 1000040 bytes
15. Requests per second: 20335.69 [#/sec] (mean)
16. Time per request: 0.492 [ms] (mean)
17. Time per request: 0.049 [ms] (mean, across all concurrent requests)
18. Transfer rate: 3396.04 [Kbytes/sec] received
19. 20. Connection Times (ms)
21. min mean[+/-sd] median max
22. Connect: 0 0 0.1 0 8
23. Processing: 0 0 0.2 0 8
24. Waiting: 0 0 0.1 0 8
25. Total: 0 0 0.2 0 8
26. 27. Percentage of the requests served within a certain time (ms)
28. 50% 0
29. 66% 0
30. 75% 0
31. 80% 0
32. 90% 1
33. 95% 1
34. 98% 1
35. 99% 1
36. 100% 8 (longest request)
So on my laptop, for a single nginx worker, we’ve got 20k+ r/s. For comparison, HelloWorld servers using nginx + php-fpm 5.2.8 gives 4k r/s, Erlang R14B2 raw gen_tcp server gives 8k r/s, and [[node.js|<http://nodejs.org/]> v0.4.8 yields 5.7k r/s.
