I have been using nginx and mongrel for my rails application on my 256 slice. It has been nice, except administration is becoming a big overhead when considering all the stuff I had to deal with fastcgi scripts for my other PHP applications/domains.
I liked nginx because of its small footprint, and high performance. However when the administrative cost is getting higher, I start to look for alternatives.
Passenger is nice because of its low administrative overhead. But it does not come cheap – it is a module for apache, meaning I will need to run Apache as my web server. Considering the fact the slice has only 256M memory, it is a hard decision to get rid of nginx and bring back Apache.
Things I had to work on is the MPM portion of Apache configuration. My stock Apache from CentOS uses prefork MPM as the default MPM. When using the default configuration, Apache started too many spare servers which uses substantial amount of memory. As a result, the system was put into swap whenever there is a HTTP request. After lowering MaxSpareServers to 6, Apache and Passenger are doing fine. Swap is never used again and the applications are more responsive.
Now I am happy.
