A little while ago I was writing about optimizing overall webserver performance for my Apache2 webserver jurismalinens.wordpress.com/2011/10/23/optimizing-apache2-web-server-and-php/ but I still wasn’t satisfied with performance.
So I decided to play with some lightweight web servers. I already have little experience with lighttpd which was used as busy video streaming website and it performed very well for this sort of job but I wanted to try something new and I choosed nginx. Installation on Centos 5 was an easy part and configuration was also an easy task (nginx documentation for adding php was little bit out of date). Because I have few IP addresses available I decided to run Apache2 with Nginx side-by-side.
I didn’t get significant reduction of CPU usage but I got improvements in memory usage and I got better response times. Nginx handled it’s tasks perfectly and it helped me to find bottlenecks more clearly- PHP and MySQL. Most of resources were eaten by those two beasts.
By installing lightweight webservers You will not get rid of all performance issues and it is only one of many things You need to consider to optimize resource usage of Your webserver.