This is not directly a Rails question but you lot seem the best to ask... I have a strong feeling we will be developing future apps in Rails (Ruby fans are slowly starting to outnumber cynics in my office) so I want a web server plan that will be appropriate for that. We have just bought two new web servers I want to turn into a load-balanced, redundant pair. As well as any Rails apps, we also need to host two Java webapps (XWiki and a JasperReports server), and a host of small, low-traffic PHP sites. The servers are Opteron 148 (2.2GHz) with 1GB RAM (maybe an extra gig would be of use here) and will run FreeBSD-6.1/amd64. The setups I've either read a lot about - or have deduced are worth looking into - are these: - Apache + mod_php + mod_fcgid (Rails) - basically what I have now, plus Rails - Apache + mod_fcgid(PHP) + (mod_proxy+Mongrel) - Lighttpd + mod_fastcgi(Rails & PHP) - the trendy way to do things :) - Lighttpd + mod_fastcgi(PHP) + Mongrel In all cases, the Java load could be quite high in CPU terms (rendering business reports), but not in page hits or number of apps so I've assumed I will go with Jetty and factored it out of the setup. I don't think it makes any difference to the choice of Apache or Lighttpd because it should work happily behind either. The load from PHP sites will be pretty minor so I'm more concerned about reducing its impact in terms of memory usage and administrative donkey work. ( Although what administrative work isn't donkey work :) ) When we start using Rails seriously we will probably get under 20,000 page views daily, and even if we convert all our apps I doubt very much we will see more than 100,000 pages views daily in the first 12 months. Because I don't need to handle 10,000 concurrent connections, I'm inclined to go with an Apache + mod_fcgid(PHP) + (mod_proxy+Mongrel / FastCGI) setup. I know Apache reasonably well, I know it can do ANYTHING and I know it NEVER lets me down. Also, by using dumping mod_php I can switch to MPM worker and gain yet more memory/scalability boosts thanks to multi-threading. Lighty fans feel free to jump in here :) That leaves a choice between Mongrel and mod_fcgid for Rails. On this point I'm pretty clueless. The main difference I can see is that Mongrel is more easily scalable if we decide to add more application servers. Anyway sorry for waffling but I can't see a decent comparison on the net except for this: http://blog.innerewut.de/articles/2006/04/21/ scaling-rails-with-apache-2-2-mod_proxy_balancer-and-mongrel , so I thought I'd run it past the Rails list. What do you all think? Cheers Ashley
on 2006-05-13 03:51
on 2006-05-13 17:29
I'm a big fan of Lighty. Its easy to configure, runs Rails super easy, and really lightweight. It also has a proxy balancer system you can make use of if that's an issue. I know that leaving Apache can be hard for some people, but my experience with Lighty has been superb. It'll support your Rails and PHP really easily, and can proxy the rest through to wherever else it needs to go.