# Haproxy vs. apache2 proxybalancer

**URL:** <https://www.ruby-forum.com/t/haproxy-vs-apache2-proxybalancer/104864>\
**Category:** Deployment\
**Created:** [May 23, 2007, 11:04am UTC](https://www.ruby-forum.com/t/haproxy-vs-apache2-proxybalancer/104864 "2007-05-23T11:04:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![morten](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@morten](https://www.ruby-forum.com/u/morten)\
**Post date:** [May 23, 2007, 11:04am UTC](https://www.ruby-forum.com/t/haproxy-vs-apache2-proxybalancer/104864/1 "2007-05-23T11:04:29Z")

</div>

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…? 🙂

---

<div class="post-metadata">

**Author:** ![morten](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@morten](https://www.ruby-forum.com/u/morten)\
**Post date:** [May 23, 2007, 5:27pm UTC](https://www.ruby-forum.com/t/haproxy-vs-apache2-proxybalancer/104864/2 "2007-05-23T17:27:33Z")

</div>

On 5/23/07, Morten [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![morten](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@morten](https://www.ruby-forum.com/u/morten)\
**Post date:** [May 23, 2007, 6:25pm UTC](https://www.ruby-forum.com/t/haproxy-vs-apache2-proxybalancer/104864/3 "2007-05-23T18:25:40Z")

</div>

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 V.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![morten](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@morten](https://www.ruby-forum.com/u/morten)\
**Post date:** [May 23, 2007, 6:26pm UTC](https://www.ruby-forum.com/t/haproxy-vs-apache2-proxybalancer/104864/4 "2007-05-23T18:26:40Z")

</div>

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 V.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![morten](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@morten](https://www.ruby-forum.com/u/morten)\
**Post date:** [May 23, 2007, 7:53pm UTC](https://www.ruby-forum.com/t/haproxy-vs-apache2-proxybalancer/104864/5 "2007-05-23T19:53:50Z")

</div>

On 5/23/07, Steve T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![morten](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@morten](https://www.ruby-forum.com/u/morten)\
**Post date:** [May 24, 2007, 9:39pm UTC](https://www.ruby-forum.com/t/haproxy-vs-apache2-proxybalancer/104864/6 "2007-05-24T21:39:15Z")

</div>

Thanks Alex, looking forward to giving it a go when I trial RubyWorks!

On May 23, 6:52 pm, “Alexey V.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
