For the longest time iSTORYA.NET has always been an Apache baby. But having no money for another server and having an “obsession” for below 1 load averages I went out and searched for an alternative. Three options came up: LiteSpeed, Lighthttpd, and nginx. LiteSpeed was too expensive and Lighthttpd was too popular and too “feature” driven. I wanted something that’s stripped down to the bare necessities (of what we need at least). I decided to give nginx a try. Installation was fairly straightforward and configuration was easy too. Since I am the type who doesn’t want to wait too long for a “switch”, I gave it a try as a reverse proxy. A few days of reading about it and a few minutes putting it up, did a couple of ApacheBench tests serving a txt file and phpinfo(); script on one of our servers. I got the results below:
Stand-alone Apache (static txt file):
Concurrency Level: 100
Time taken for tests: 21.366951 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 26101044 bytes
HTML transferred: 0 bytes
Requests per second: 4680.12 [#/sec] (mean)
Time per request: 21.367 [ms] (mean)
Time per request: 0.214 [ms] (mean, across all concurrent requests)
Transfer rate: 1192.92 [Kbytes/sec] received
Apache w/nginx as reverse proxy (static txt file):
Concurrency Level: 100
Time taken for tests: 9.336450 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Non-2xx responses: 100018
Total transferred: 30505490 bytes
HTML transferred: 16202916 bytes
Requests per second: 10710.71 [#/sec] (mean)
Time per request: 9.336 [ms] (mean)
Time per request: 0.093 [ms] (mean, across all concurrent requests)
Transfer rate: 3190.72 [Kbytes/sec] received
Stand-alone Apache (dynamic phpinfo();):
Concurrency Level: 100
Time taken for tests: 39.655921 seconds
Complete requests: 100000
Failed requests: 15
(Connect: 0, Length: 15, Exceptions: 0)
Write errors: 0
Total transferred: 435963771 bytes
HTML transferred: 418862574 bytes
Requests per second: 2521.69 [#/sec] (mean)
Time per request: 39.656 [ms] (mean)
Time per request: 0.397 [ms] (mean, across all concurrent requests)
Transfer rate: 10735.98 [Kbytes/sec] received
Apache w/nginx as reverse proxy (dynamic phpinfo();):
Concurrency Level: 100
Time taken for tests: 33.87610 seconds
Complete requests: 100000
Failed requests: 4
(Connect: 0, Length: 4, Exceptions: 0)
Write errors: 0
Total transferred: 499292625 bytes
HTML transferred: 481491913 bytes
Requests per second: 3022.28 [#/sec] (mean)
Time per request: 33.088 [ms] (mean)
Time per request: 0.331 [ms] (mean, across all concurrent requests)
Transfer rate: 14736.33 [Kbytes/sec] received
That’s a 128% increase in RPS for static files and a notable 17% increase for dynamic pages!… after seeing the results on the test server I immediately installed and migrated it on iSTORYA.NET. Upon switching, pages seemed to fly and the server load went down below 1 most of the time from 2 on peak hours… and more importantly, the number of processes running on the server dropped by a hundred. I am happy, server is happy, Wordpress and vBulletin are happy… at least for now. I will continue to learn about nginx and hopefully be able to replace Apache completely with it. 
Random Thoughts apache, istorya.net, lighthttpd, litespeed, nginx, reverse proxy, web server