So long Apache and thanks for all the fish
posted by gchatz 3 commentsApache has been good to us, and we have been good to him.
For quite a while we’ve been using Apache and mod_proxy_balancer to distribute requests to mongrels .
But, while adding a new twin server for Skroutz we had to say goodbye.
Nginx is a great replacement for apache.
It’s light, easy to configure and light. Very light. Feather light.
2215 www-data 15 0 27520 2540 752 S 0 0.1 1:14.69 nginx
2214 www-data 15 0 27688 2616 776 S 0 0.1 1:15.78 nginx
2216 www-data 15 0 27716 2692 776 S 0 0.1 1:06.48 nginx
2217 www-data 15 0 27552 2528 776 S 0 0.1 1:13.83 nginx
2218 www-data 15 0 27584 2552 752 S 0 0.1 1:04.59 nginx
Nginx takes 0.1% of memory per worker process during rush hours. That’s 20MB for the whole setup, while apache could easily take up to 7-9 MB per process and we’ve seen cases of 100 apache processes hanging here and there.
We’ve tried nginx with fcgi and php (for you php-iers) and it works like a charm.
If you have static file servers (images, etc) nginx could save you server from a lot of trouble.

Comments (3)
I also use nginx and would never go back to apache.
I've used nginx for rails and serving static content for a while and I think it's great - just what the doctor ordered for people with low memory VPS accounts like me.
I tried it with PHP CGI and couldn't manage to make the PHP processes play nicely so I ended up running apache on a high local port to serve PHP requests. I would be very grateful if you can post your steps to a good nginx PHP setup or a link.
Thanks!
ukmatt:
I've used the example on the nginx documentation wiki (http://wiki.codemongers.com/NginxFcgiExample)
On my gentoo machine I use spawn-fcgi to start fcgi processes and use nginx as a proxy server.
My configuration is identical to the configuration in the link above.
Hope this helps.