Apache2/Mongrel vs. Apache1/FastCGI vs. Pound of Mongrels

November 8, 2006

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.

fcgivsmongrelsmall

Here’s the lineup:

  • 1. The hip new server I had been dying to test is Apache 2.2.3 using mod_proxy with Mongrel 0.3.13.4.
  • 2. Our current server is Apache 1.3.37 and FastCGI 2.4.0.
  • 3. The lightweight, no-frills Pound 2.1.6 with Mongrel 0.3.13.4.
  • 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.

    Advertisements

    6 Responses to “Apache2/Mongrel vs. Apache1/FastCGI vs. Pound of Mongrels”


    1. Can you post a sample of your Apache FastCGI config?

      Thanks!

    2. Test Says:

      Hello

      G’night


    3. […] Apache2/Mongrel vs. Apache1/FastCGI vs. Pound of Mongrels « ckh sponge (tags: rails) […]


    4. 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.

    5. Rohan Says:

      What about using apache 2.2 with mod_proxy_balancer sending the requests to mongrels? That’s our current setup…

    6. Chris Hobbs Says:

      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/


    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s

    %d bloggers like this: