Lighty Web Server Fast with static pages
Three months ago I started looking at an alternative web server to serve URL redirects.Â The need arose when I found that Apache web server would consume a lot of system memory when testing simulated spikes to the server.Â Apache could handle between 1,200 to 1,700 requests a second.Â Though the number of requests per second was satisfactory, the memory usage when these simulated spikes was concerning.
I did some research and came across Lighttpd web server, also known as Lighty.Â Lighty took some time to figure out, but once I did I found the XML style configuration files were not hard to implement and understand.Â I did find the rewriting to be rather limited in comparison to the mod_rewrite module found in Apache.Â Never the less, I was able to duplicate the rewrite that I had in Apache in Lighty.Â For my application, I did have to modify the Lighty source code that way redirects returned a 302 HTTP response (It defaulted to 301 without any way of changing in the configuration files).
After performing similar tests with the same server configured with Lighty, I found that Lighty could handle between 3,900-4,100 requests per second.Â On top of this, memory usage was minimized to only a fraction of the total memory available on the server.Â Processor usage did increase, but was not substantial enough to warrant the change.
I am currently experimenting with combining Lighty with Apache services on one server in order to utilize the best of both worlds.Â See my post on the lighttpd.net forums: http://forum.lighttpd.net/topic/13830
Lighty may be able to also serve dynamic PHP files using FastCGI faster than Apache.Â I am still concerned that PHP will not function correctly since it is not multi-threaded friendly.Â I also have security concerns based on what I’ve seem with source code being exposed with a popular web site recently, I am not ready to take on that much risk.