[Mongrel] Mongrel performing only half as fast as Apache?

Zed A. Shaw zedshaw at zedshaw.com
Wed Feb 28 11:58:23 EST 2007

On Tue, 27 Feb 2007 15:40:30 -0800
"Christopher Bailey" <chris at codeintensity.com> wrote:

> I'm trying to do some initial benchmarking of our setup, mainly just to
> establish baselines.  I'm essentially using the process Zed outlines in a
> previous message:
> http://rubyforge.org/pipermail/mongrel-users/2006-May/000200.html

Don't forget, this is also available which is pretty much the same


> - Using httperf for testing, with the following command:
>   httperf --server lab05 --port 80 --uri /mongrel_alive.html --num-conns
> 10000

That's fine for a httperf command.

> Here's the results:
> - Just Apache, num-conns=15000, ~1400 req/sec
> - Direct to Mongrel on port 5000, num-conns=8000, ~740 req/sec
> - Apache mod_proxy_balancer to a single Mongrel, num-conns=5000, ~475
> req/sec

The apache numbers look way off.

> So, I'm incurring a massive penalty for the balancer/cluster setup.  In
> production we will be using hardware load balancers, but even still, my
> understanding was that instead of a drop from 1400 to 740, it should be
> somewhat closer (say at least over 1000).

Well, it's not "massive" but you should test other configurations and
validate that you have apache configured right.  My first thought is
that your apache configuration is slow to begin with, which might mean
that it's not tuned properly.  There's several different workers you
can use so try them out and see which is the best.  Also, try nginx and
your hardware load balancer.

Your next thing to do is see if you can get a very small sample RoR
application that just renders "test" to perform.  If RoR performs less
than 475/sec then there's no point in stressing over the drop in
performance because of apache.  You'll just have to know that you won't
be able to push it above that.

Finally, you may be worrying about this way too much in the beginning.
You've measured there's a potential problem, you should then try to
rule it out (apache is the hypothetical cause), but if you can't then
this just factors into your planning for the production deployment.
It's not the end of the world.

Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu
http://www.awprofessional.com/title/0321483502 -- The Mongrel Book
http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.

More information about the Mongrel-users mailing list