I am investigating into HAProxy to use as a load balancer for a number of nginx servers. Each server is streaming a static file (audio file) from it. Nginx will be using a symfony2 framework. In regards to affinity / persistance of sessions, I will be using memcached on nginx servers. I am starting with a limited budget so I am trying to derive networking scheme as flexible and scalable as possible. I will draw a diagram to simply my question:

           +---> nginx server 1 @ 1gbps
HAProxy <--+---> nginx server 2 @ 1gbps
           +---> nginx server 3 @ 1gbps

Ps: I understand that I will need 2nd haproxy server for failover but unfortunately I can't afford more servers at the moment.

My primary concern is how "reply" is done with HAProxy. To my understanding, if reply is going through HAProxy, LB becomes a bottleneck as it won't be able to serve more users than its port capacity (bare in mind it is a streaming server with a hypothetical load of 95%). However, I see that people say HAProxy only does routing but I am not sure what it means if inbound & outbound traffic is still going through HAProxy.

  • You have probably figured this out 3 years ago, but I have the exact same problem and I am looking at Direct Server Return (DSR) to solve the problem of upstream traffic. Take a look here for the full explanation: blog.haproxy.com/2011/07/29/… – mattis Oct 18 '16 at 12:30

The HAProxy has to be a high bandwidth server. It has to have at least the bandwidth of the backend servers combined so it doesn't throttle everything. In the best case you have a little headroom left. A 10GBps connection might be good for the start.

On the other hand it doesn't need the biggest CPU. That is what "the people" might mean. Because the backend servers can focus on the calculations, the HAProxy only needs to route the traffic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.