[Mongrel] Determining ideal number of Mongrels for an app?

Philip Hallstrom mongrel at philip.pjkh.com
Tue Nov 28 16:23:14 EST 2006

> On Tue, Nov 28, 2006 at 11:03:06AM -0600, Philip Hallstrom wrote:
>>> What's a rule of thumb for guesstimating how many
>>> Mongrels to use in a cluster for an app? I have an app
>>> that gets about 5000 unique visitors per day. I
>>> figured I'd give it plenty of Mongrels -- twenty to be
>>> specific. After running out of memory and hitting the
>>> swap periodically, I scaled it back to five and it
>>> still seems to serve up visitors fine. So, is there
>>> some super-secret math fomula I can use to determine
>>> the ideal number of Mongrels I should start in a
>>> cluster for an app?
>> http://mongrel.rubyforge.org/docs/how_many_mongrels.html
>> Just for reference, we get about 500,000 pages a day and run 4 mongrel
>> processes... we've got about 20 servers[1], but 4 gives us the best
>> performance.
> I'm curious - do you have 4 * 20 Mongrels or just 4? How many
> requests/sec does Rails report in your logs?

We have 4 mongrels per server.

Just did a quick grep on one of the servers log files and for about 6000 
requests we are averaging 38 reqs/sec with a standard deviation of 113.

If I throw out about 2700 requests that I know are slow (< 5 req/s mostly 
cause we can't cache them) the average goes to 65 reqs/sec.

Like I said, we only need those for a little bit every year... during the 
world series of poker.  People really like there poker :)



More information about the Mongrel-users mailing list