This post originated from an RSS feed registered with Ruby Buzz
by Bob Silva.
Original Post: Choosing a Rails Deployment Platform - So Many Choices
Feed Title: Rails Video Tutorials
Feed URL: http://www.railtie.net/xml/rss/feed.xml
Feed Description: A growing collection of screencasts that show you how to use the many facets of the wonderful world of rails.
Choosing a Rails Deployment Platform is a well-documented but still confusing activity. You have so many choices you need to make, FCGI, Mongrel, Apache, Lighttpd, LiteSpeed, LSAPI, Rewrite Engine, 404 Handler, mod_proxy ... and the list goes on.
The Plan
I just ordered a new webserver to replace my aging Dual 850mhz box and I thought I had a plan worked out. Since I still have legacy PHP applications, I chose to use LiteSpeed to power them. LiteSpeed outperforms Apache/mod_php by quite a bit of margin when serving PHP generated content. LiteSpeeds UI for administration also makes it much simpler to manage all the VIrtual Host setups as well.
All the cool kids are using mongrel nowadays for Rails Deployment. Always wanting to hang with the cool kids, I decided that Apache2 would proxy balance to a mongrel cluster for my applications. I planned on running Apache2 on a separate interface anyways to host my projects with SVN.
Testing It
Ok, we have LiteSpeed and Apache2 running on different interfaces on the server. I run ab2 against the LiteSpeed/PHP first using a static html file, then using a Hello World PHP page. The static page registered in at 20K+ rps. Wow, looking good so far. The PHP clocked in at 5K+ rps. Pretty good numbers so far. +1 for choosing LiteSpeed to run the PHP applications.
Moving on to Apache2. I created a Hello World Rails application, lit up a 6-pack of mongrels (using a concurrency of 10 in ab2), ran ab2 and WTH????. 60rps. What a let down. I rerun the test just hitting the index.html of the Rails app, and the numbers come back up to 15K+. Doesn't sound right to me so I tweaked Apache for awhile but to no avail.
Just for SAG, I decided to setup a Hello World Rails application in LiteSpeed. For this configuration, I chose the LSAPI and used a 404 Redirect. Since I didn't want my hopes dashed right away, I decided to just hit the index.html of the Rails app. 10K rps. Hmmmm. That's lower than the Apache2 marks. Maybe this wasn't a good idea. So I'm thinking the Hello World will cash in around 45-50 rps. Let's run it. WTH????. Averaging 400 rps in this configuration. I tinkered around with Apache2 some more to try to get the numbers up, but it just didn't happen.
The Result
With the simple benchmarks I did, they gave me enough information to make a better choice for a deployment platform for Rails. I didn't test lighttpd at all and don't plan to. I don't really care that LiteSpeed is a commercial offering, the developers listen to their customers (even the freeloaders like me) and incorporate changes or fixes quickly. They've been extremely supportive of the Rails community and continue to make changes tailored to running Rails applications.