4 ms·
HAProxy's primary feature is HTTP/HTTPS load balancing. This new feature competes only with HAProxy's TCP load balancing support. Note that Nginx already has a
by lobster_johnson 12y ago
HAProxy's primary feature is HTTP/HTTPS load balancing. This new feature competes only with HAProxy's TCP load balancing support.
Note that Nginx already has a simple proxy built in that does very basic HTTP load balancing. HAProxy's is vastly superior to Nginx's in that it supports a sophisticated set of filters ("ACLs"), transformations (eg., header rewriting), queue behaviours (eg., queue limits, backup backends, health checks, retries) and proxy-specific request logging.
A big difference is that HAProxy's main balancing algorithm is "fair", in that traffic is distributed evenly among target backends, whereas Nginx's load balancing is purely round-robin (there is a third-party fair balancing module [1], but it's not maintained).
[1] https://github.com/gnosek/nginx-upstream-fair https://github.com/gnosek/nginx-upstream-fair
- Jgrubb 12y agoActually, Nginx has a couple of different load balancing algos that you can pick from -- http://nginx.org/en/docs/http/load_balancing.html http://nginx.org/en/docs/http/load_balancing.html
- lobster_johnson 12y agoI wasn't aware of that. Thanks.
- toomuchtodo 12y agoThank you!
- jfindley 12y ago> A big difference is that HAProxy's main balancing algorithm is "fair" I don't think that's really true - haproxy has lots of load balancing modes, none of which are called "fair". It's also very unclear what you'd mean by "fair" in this context. Least connection? Maybe, but with a traffic pattern with large volumes of very short-lived requests, least connection actually won't be very fair at all, and will end up loading some servers more than others. Roundrobin isn't really "fair" either, if you have a mix of short and long requests.
- lobster_johnson 12y agoWell, "fair" was in quotes for a reason. My only point was something that HAProxy has something that distributes based on state, as opposed to round robin or random distribution.