Nginx vs Node.js (clustered) static file Siege Benchmarks

Just a noob playing around with node.js to see what it can do as a static file server compared to Nginx 1.2.7 web server. Ran Siege benchmark tests on local computer via Virtualbox CentOS 6.3 63bit server instance.

Siege Benchmark Summary

Quite interesting to see how well node.js clustered static file server scaled almost 2x times better in terms of transactions per second compared to Nginx web server (4,250 trans/s vs 2,118 trans/s) - especially at the higher concurrency levels. Also check out average response times (0.14s vs 0.23s), longest transaction time (1.10s vs 13.95s) and transaction availability numbers all in node.js's favour.

Test Target VirtualBox Server Config:

  • Xeon W3550 @3380Mhz with 4 cpu threads
  • 1280MB DDR3-1536Mhz
  • 20GB storage on 1TB Western Digital Black Caviar SATA disk

Servers Tested:

  • Centmin Mod Nginx v1.2.7 server with 4 worker_processes (port 80)
  • Centmin Mod node.js Cluster server (4 processes) (port 8080)

Siege benchmark test parameters:

  • Benchmark mode -b used
  • 100 to 600 concurrent users @500 reps and 5s delay
  • Cache validation enabled
  • Using Siege benchmark I ran Siege load test against a static html file which consisted of 50x lipsum auto generated paragraphs from lipsum.com in a html file named lipsum.html.

The lipsum.html file

  ls -lah /usr/local/nginx/html/ | grep lipsum

-rw-r--r--  1 root  root   33K Mar  1 14:04 lipsum.html

Process listing:

ps aufx | egrep 'nginx|cserver' | grep -v grep

root      9992  0.0  0.0  22092   956 ?  Ss   07:01   0:00 nginx: master process /usr/local/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nginx     9993  0.1  1.1  35472 14504 ?  S<   07:01   0:00  \_ nginx: worker process                                    
nginx     9994  0.1  1.1  35472 14452 ?  S<   07:01   0:00  \_ nginx: worker process                                    
nginx     9995  0.1  1.0  34904 14044 ?  S<   07:01   0:00  \_ nginx: worker process                                    
nginx     9996  0.1  1.0  34904 14032 ?  S<   07:01   0:00  \_ nginx: worker process                                    

root     10097  9.6  2.7 679724 35104 ?  Ssl  07:09   0:00 /usr/local/bin/node 
/usr/local/lib/node_modules/forever/bin/monitor cserver.js
root     10099  3.6  1.2 658484 16256 ?  Sl   07:09   0:00  \_ /usr/local/bin/node /var/www/node-lserver/cserver.js
root     10101  5.5  1.2 658568 16292 ?  Sl   07:09   0:00      \_ /usr/local/bin/node /var/www/node-lserver/cserver.js
root     10102  6.0  1.2 658568 16288 ?  Sl   07:09   0:00      \_ /usr/local/bin/node /var/www/node-lserver/cserver.js
root     10103  5.5  1.2 658568 16292 ?  Sl   07:09   0:00      \_ /usr/local/bin/node /var/www/node-lserver/cserver.js
root     10105  5.5  1.2 658568 16292 ?  Sl   07:09   0:00      \_ /usr/local/bin/node /var/www/node-lserver/cserver.js

Nginx 1.2.7 web server

  curl -I http://192.168.56.140/lipsum.html

HTTP/1.1 200 OK
Server: nginx
Date: Fri, 01 Mar 2013 22:29:31 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Vary: Accept-Encoding
Expires: Sun, 31 Mar 2013 22:29:31 GMT
Cache-Control: max-age=2592000
Pragma: public
Cache-Control: public, must-revalidate, proxy-revalidate

Centmin Mod Node.js clustered server

  curl -I http://192.168.56.140:8080/lipsum.html

HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Content-Encoding: gzip
Last-Modified: Fri, 01 Mar 2013 04:04:56 GMT
Cache-Control: public, max-age=2592000, must-revalidate
x-powered-by: centminmod nodejs
Date: Fri, 01 Mar 2013 22:29:26 GMT
Connection: keep-alive

Nginx 1.2.7 web server

Centmin Mod Nginx 1.2.7 server - siege benchmark results static html file

Centmin Mod Node.js clustered server

Centmin Mod Node.js Clustered server - siege benchmark results static html file