haproxy vs. apache2 proxybalancer

7 views
Skip to first unread message

Morten

unread,
May 23, 2007, 5:03:42 AM5/23/07
to Deploying Rails

Hi,

I'm thinking of switching to using RubyWorks rather than keep rolling/
maintaining my own stack. Until now, I've used Apache2 Proxy balancer
for my mongrel cluster. I see that RubyWorks ships HAProxy instead.
Anyone care to tell me of the pros/cons using HAProxy?

My hunch is that HAProxy vs. Apache2 Proxy is same-same.

Thanks.

Morten

PS: When will we see RubyWorks for OpenSolaris..? :-)

Alexey Verkhovsky

unread,
May 23, 2007, 11:26:59 AM5/23/07
to rubyonrails...@googlegroups.com
On 5/23/07, Morten <prim...@gmail.com> wrote:
> I'm thinking of switching to using RubyWorks rather than keep rolling/
> maintaining my own stack. Until now, I've used Apache2 Proxy balancer
> for my mongrel cluster. I see that RubyWorks ships HAProxy instead.
> Anyone care to tell me of the pros/cons using HAProxy?

Cons: yet another process to manage.

Pros: HAProxy (as configured in RubyWorks stack) sends only one
request at a time to any Mongrel in the cluster, thus preventing
requests from piling up on a Mongrel that is stuck for a long time
inside Rails handler. As a side-effect, this also prevents Mongrels
from allocating extra 50 Mb of RAM per process under load, which is
important when you are running multiple relatively inactive apps on
the same hardware.

--
Alex Verkhovsky

Steve Tooke

unread,
May 23, 2007, 12:24:02 PM5/23/07
to Deploying Rails
How do you set up the system to handle static files using HAProxy?
mod_rewrite in apache or similar to front it, as you would with a
mongrel_cluster?

Does HAProxy support X-SendFile hearder?

On May 23, 4:26 pm, "Alexey Verkhovsky" <alexey.verkhov...@gmail.com>
wrote:

Steve Tooke

unread,
May 23, 2007, 12:24:16 PM5/23/07
to Deploying Rails
How do you set up the system to handle static files using HAProxy?
mod_rewrite in apache or similar to front it, as you would with a
mongrel_cluster?

Does HAProxy support X-SendFile hearder?

On May 23, 4:26 pm, "Alexey Verkhovsky" <alexey.verkhov...@gmail.com>
wrote:

Alexey Verkhovsky

unread,
May 23, 2007, 1:52:52 PM5/23/07
to rubyonrails...@googlegroups.com
On 5/23/07, Steve Tooke <steve...@gmail.com> wrote:
> How do you set up the system to handle static files using HAProxy?
> mod_rewrite in apache or similar to front it, as you would with a
> mongrel_cluster?

Yes. The only difference is that you use normal mod_proxy and let
HAProxy do the load balancing.

> Does HAProxy support X-SendFile hearder?

We haven't specifically tested the functionality you are thinking
about (serving large files) with this stack, but HAProxy simply passes
HTTP headers back to the web server.

--
Alex

Steve Tooke

unread,
May 24, 2007, 3:38:08 PM5/24/07
to Deploying Rails
Thanks Alex, looking forward to giving it a go when I trial RubyWorks!

On May 23, 6:52 pm, "Alexey Verkhovsky" <alexey.verkhov...@gmail.com>
wrote:

Reply all
Reply to author
Forward
0 new messages