[Mongrel] Optimal Configuration

Zed Shaw zedshaw at zedshaw.com
Wed Aug 23 05:41:19 EDT 2006

On Wed, 2006-08-23 at 10:07 +0100, Tim Perrett wrote:
> Hey all
> First off, ive just switched to using mongrel_cluster and pound - its
> working a treat! Its far far faster than fast-cgi: operations that took a
> few seconds on fcgi now are almost instant with mongrel. Excellent!
> However, I've been trying to decide how best to utilise my equipment most
> effectively. I have a dual pro 3Ghz Xenon with 2GB RAM, and the server will
> be running a few different applications - some rails, some php. Seeing as I
> was using lighty before I switched im keeping my PHP on lighty and proxying
> through pound but my rails apps are now on mongrel, but how many instances
> would deliver the best performance on what im running? I wasn't sure if
> mongrel got busy would it hog a lot of ram or something like that.

The best way to find your "utilization sweet spot" is to do something
like the following:

1) Write a simple rails app with a test controller that just returns the
word "test" with render text.  This is the fastest little rails action
you could have, so make sure your configuration is tight an this is the
fastest.  Do this with just one mongrel and measure it using ab or
2) Once you have a single mongrel running well, proceed to add mongrels
and retest (make sure you increase the concurrency too) until adding
mongrels doesn't improve performance of this fastest action.
3) This is probably your sweet spot, now just run these tests on the
various actions you have in your real app and see how everything works
for ram and cpu usage.

After that you'll have to get into different configs, tuning your OS,
etc. but at least you'll have found a good start.

Also, retest this same scenario when new versions of rails come out or
you deploy a new version of your app.  Every time the conditions of your
last test change you need to re-run them.  It's just like unit testing,
you gotta keep doing it or it's pointless.

Zed A. Shaw
http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.

More information about the Mongrel-users mailing list