Live data from Hacker News

NGINX open sources TCP load balancing

hg.nginx.org

31–40 of 121 posts

Re: NGINX open sources TCP load balancing

#31

Can someone explain how this is superior to HAproxy?

from what i understand, this could be used for anything tcp related (here[0] they said it could be used to proxy mysql, ldap, rtmp and they use pop3 as an example). i thought haproxy was used basically to proxy http stuff, not general tcp. [0] http://nginx.com/resources/admin-guide/tcp-load-balancing/

HAProxy is fundamentally a L3/L4 proxy, with some specific HTTP features (all the nice throttling stuff can use only L3/L4 signals for example).

Re: NGINX open sources TCP load balancing

#32
post #30
post #25

Earlier quoted context omitted.

Because I would still need to run NGINX alongside it to handle HTTP proxying. By removing HAProxy from the stack, I have one less component to manage/maintain/upgrade. I've used HAProxy for a long time and been very happy with it. But, everything else being equal, a stack with n-1 components is better than a stack of n components.

Why not use HAProxy for HTTP proxying? If you want to drop one component from the stack it could just as well be NGINX.

Because HAproxy's ability to work with URLs and headers is close to unusable.

Re: NGINX open sources TCP load balancing

#36
post #34

can this loadbalance redis and memcache?

Yes it could. You would either need to have redis slave replication setup and then only load balance your read-replicas, or else you would need to use sticky sessions to always send requests back to the right node.. I'm not sure if sticky sessions is possible with TCP loadbalancing in nginx but I assume it is.

Re: NGINX open sources TCP load balancing

#37

Maybe they'll bring in the health checks for HTTP balancing, next :).

If you don't mind building your own package, this has worked well for us: https://github.com/yaoweibin/nginx_upstream_check_module

Though I agree it'd be nice to have the functionality integrated.

Re: NGINX open sources TCP load balancing

#38

Can someone explain how this is superior to HAproxy?

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

Re: NGINX open sources TCP load balancing

#39

Can someone explain how this is superior to HAproxy?

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,…

Actually, Nginx has a couple of different load balancing algos that you can pick from -- http://nginx.org/en/docs/http/load_balancing.html
Post reply on HN