apache vs nginx/lighttpd

Many articles out there extol the benefits of the event based servers such as nginx/lighttpd over apache. It supposedly consumes less resources under high load and excels at serving static pages.

Unfortunately here I am still using apache, which up until recently had very erratic performance. Analysing the loading showed that the Time to First Byte could take up to 10s, wonder what apache is doing, spinning up threads? Anyway, with caching configured, I am starting to see better performance usually below 5s. Not sure if I should move over to nginx/lighttpd. The reason why I chose apache in the first place was because it was more widely used, hence better stability and more documentation compared to its newer cousins. Furthermore, better resource efficiency didn't really matter since my site isn't high traffic in the first place.

Some have even recommended using nginx as a recursive caching server in front of apache but seems a little unnecessary to me. Might move over to nginx/lighttpd soon depending on what the pi community feels. Even though I'm not using a pi, its the largest ARM processor community and stuff that works well on x86 might not play nice on ARM. Will do more reading before deciding.


After doing apache bench to test out the performance of apache, the results seem to point to something else, perhaps the router since after all I am using a free singtel aztech router designed for residential use and that might have stalled unsolicited connections. Out of 1000 requests, ab managed to serve up 100 concurrent connections in 0.113 seconds to localhost, 95% of requests took no longer than 130ms to serve and all connections took a maximum of 171ms. It might not be as fast as lighttpd but I am not going to see 100 simultaneous connections on my website, let alone a 1000. The bottleneck lies somewhere else.