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. Document Path: /
  5. Document Length: 20 bytes
  6. Concurrency Level: 10
  7. Time taken for tests: 2.459 seconds
  8. Complete requests: 50000
  9. Failed requests: 0
  10. Write errors: 0
  11. Total transferred: 8550342 bytes
  12. HTML transferred: 1000040 bytes
  13. Requests per second: 20335.69 [#/sec] (mean)
  14. Time per request: 0.492 [ms] (mean)
  15. Time per request: 0.049 [ms] (mean, across all concurrent requests)
  16. Transfer rate: 3396.04 [Kbytes/sec] received
  17. Connection Times (ms)
  18. min mean[+/-sd] median max
  19. Connect: 0 0 0.1 0 8
  20. Processing: 0 0 0.2 0 8
  21. Waiting: 0 0 0.1 0 8
  22. Total: 0 0 0.2 0 8
  23. Percentage of the requests served within a certain time (ms)
  24. 50% 0
  25. 66% 0
  26. 75% 0
  27. 80% 0
  28. 90% 1
  29. 95% 1
  30. 98% 1
  31. 99% 1
  32. 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.