I did some performance testing of different server technologies on one of our AMD Sempron 2600s since we are thinking about upgrading our servers. Spongecell uses Ruby on Rails 1.1.6 and MySql 5.0.24a.
Here’s the lineup:
I pounded each of these servers with Apache Bench hitting one of our event/view links .e.g. ArnoCorp. This is a rails action that does some sql queries and renders rhtml.
/usr/sbin/ab -c100 -n500 http://127.0.0.1/event/view/id
Results
All three servers performed similarly. FastCGI maxed at 19.1 requests/second whereas Mongrel only got to 17.1 requests/second. The optimum number of processes seemed to be about 12 for each server type. For serving a small static html file the Apache servers served ~1700 per second and Pound served 450.
Conclusion
Mongrel and Pound are very easy to set up. In terms of performance, FastCGI is ahead by about 10%. I’m not sure 10% is significant enough to justify using FastCGI, it might be. We had FastCGI configured poorly for awhile and it led to some instabilities. FastCGI is a little tricky to configure for the first time unless you’re very familiar with httpd.conf. Since Spongecell has experience with FastCGI I suspect we will stick with it. For someone setting up a Rails server for the first time I would recommend using Pound to start with. You can then switch to Apache when you need more features or when serving static content becomes important.

December 28, 2006 at 1:50 pm
Can you post a sample of your Apache FastCGI config?
Thanks!
March 30, 2007 at 6:18 am
Hello
G’night
August 11, 2007 at 8:25 am
[...] Apache2/Mongrel vs. Apache1/FastCGI vs. Pound of Mongrels « ckh sponge (tags: rails) [...]
August 20, 2007 at 2:09 pm
I only ever use FastCGI. Its not the new hotness but since I have servers that run PHP4, PHP5 and Rails all needing to coexist I have found that FastCGI gives me a good evnironment without any performance problems.
Also, since FastCGI can be built right into Apache and LightTPD it keeps my stack nice and simple, no proxies, no multiple tiers at the application layer, nice and short.
You definitely need to understand its configuration since it can present some funny errors and other bad behavior if you don’t get the config right.
November 12, 2007 at 9:03 pm
What about using apache 2.2 with mod_proxy_balancer sending the requests to mongrels? That’s our current setup…
November 12, 2007 at 10:11 pm
Apache 2 with mongrels is setup #1 for these tests. On a side note, we are currently using Nginx with mongrels at Engine Yard.
http://spongetech.wordpress.com/2007/06/04/layered-tech-vs-engine-yard/