Live data from Hacker News

NGINX open sources TCP load balancing

hg.nginx.org

71–80 of 121 posts

Re: NGINX open sources TCP load balancing

#71
post #47
post #14

Many installations would go from haproxy->nginx to nginx->nginx. Having to support a single product will make many devops happy. In the same tense, haproxy is adding Lua support[1], which has been available in nginx - using openresty[2] - since 2011, and nginx core is doing the same with Javascript[2]. Interesting times aroung haproxy and nginx. [1] http://blog.haproxy.com/2015/03/12/haproxy-1-6-dev1-and-lua/ [2] htt…

Not sure about that... HAproxy is a proven technology (very reliable and a joy to use at that) in this field while Nginx is a newcomer and needs to establish its credibility first. I personally wouldn't use such technology for load balancer until it is properly battle-tested. Also, I can't see much of an advantage over (proven) HAproxy - am I missing something? As for supporting a single product, I don't see the poin…

HAProxy offers a better DDos mitigation configurables in comparison to nginx. Thats it.

Re: NGINX open sources TCP load balancing

#72
post #14

Many installations would go from haproxy->nginx to nginx->nginx. Having to support a single product will make many devops happy. In the same tense, haproxy is adding Lua support[1], which has been available in nginx - using openresty[2] - since 2011, and nginx core is doing the same with Javascript[2]. Interesting times aroung haproxy and nginx. [1] http://blog.haproxy.com/2015/03/12/haproxy-1-6-dev1-and-lua/ [2] htt…

Not to mention the vast ecosystem of some really great nginx plugins. The one thing I have found desperately wanting in both nginx and haproxy is the support for real-time stats and filtering found in Varnish (supports HTTP only). I am absolutely hooked!

  // Query Times
  varnishncsa -F '%t %{VCL_Log:Backend}x %Dμs %bB %s %{Varnish:hitmiss}x "%r"'

  // Slow Queries
  varnishncsa -F '%t %{VCL_Log:Backend}x %Dμs %bB %s %{Varnish:hitmiss}x "%r"' -m "VCL_Log:SlowQuery"

  // Top URLs
  varnishtop -i RxURL

  // Top Referer, User-Agent, etc.
  varnishtop -i RxHeader -I Referer
  varnishtop -i RxHeader -I User-Agent

  // Cache Misses
  varnishtop -i TxURL

  // awesome dashboard
  varnishstat

Re: NGINX open sources TCP load balancing

#73
post #47
post #14

Many installations would go from haproxy->nginx to nginx->nginx. Having to support a single product will make many devops happy. In the same tense, haproxy is adding Lua support[1], which has been available in nginx - using openresty[2] - since 2011, and nginx core is doing the same with Javascript[2]. Interesting times aroung haproxy and nginx. [1] http://blog.haproxy.com/2015/03/12/haproxy-1-6-dev1-and-lua/ [2] htt…

Not sure about that... HAproxy is a proven technology (very reliable and a joy to use at that) in this field while Nginx is a newcomer and needs to establish its credibility first. I personally wouldn't use such technology for load balancer until it is properly battle-tested. Also, I can't see much of an advantage over (proven) HAproxy - am I missing something? As for supporting a single product, I don't see the poin…

> As for supporting a single product, I don't see the point of that.

It's not about configuration; it's about security. Fewer products in your stack means fewer things to patch. Rather than updating nginx some times and haproxy other times, you just update nginx across all your machines (both web servers and load balancers), and you're done. This also gives you more time with which to vet any given nginx update.

Re: NGINX open sources TCP load balancing

#74
post #41

Earlier quoted context omitted.

Surely you must have misread the docs, it's pretty damn powerful.

I ran 1.4 in production at a 8,000+ QPS social network, have been on a team who submitted patches to Tarreau that are now in HAproxy, and very intentionally put Openresty behind it for HTTP after months of tweaking a very fragile HAproxy configuration with several applications hanging off our property's domain name. I also architected and built a LBaaS product at a well-known hosting provider using HAproxy. I didn't…

I'd challenge ELB usage in such configuration. R53 should be enough.

Re: NGINX open sources TCP load balancing

#75
post #40

Anyone know if the nginx TCP load balancing supports the PROXY protocol? Doesn't appear to, which is unfortunate.

It doesn't at this stage. That is in the plan, but there are other features we'd like to implement first.

Thanks. For reference, the use case is to distribute SSL negotiation without losing access to client IP addresses.

Re: NGINX open sources TCP load balancing

#76
post #6

Does that mean that I can now put NGINX in front of a cluster of TCP (non HTTP) servers and get NGINX to cleverly load balance the incoming requests to the individual nodes ?

> load balance the incoming requests to the individual nodes

Correct me if I am wrong but I think this is actually incorrect, because there is no concept of "request" at the tcp level. If I understand correctly it will rather load balance "connections".

Re: NGINX open sources TCP load balancing

#77
post #27

I didn't see anything about proxy protocol support, which is kind of nice with TCP load balancing... http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt

Yes this is important if you want to load balance http traffic at the TCP level and have the remote address in the back end app. Nginx already support decoding the proxy protocol but I wonder if with this new feature you can encode the remote address with proxy protocol.

Re: NGINX open sources TCP load balancing

#78
post #74

Earlier quoted context omitted.

I ran 1.4 in production at a 8,000+ QPS social network, have been on a team who submitted patches to Tarreau that are now in HAproxy, and very intentionally put Openresty behind it for HTTP after months of tweaking a very fragile HAproxy configuration with several applications hanging off our property's domain name. I also architected and built a LBaaS product at a well-known hosting provider using HAproxy. I didn't…

I'd challenge ELB usage in such configuration. R53 should be enough.

It's nice for clean removal of a HAproxy from rotation as well as insulating against HAproxy failures without worrying about DNS caching, not to mention wildly different DNS behavior on different platforms. Some platforms unconditionally use only the first address in a RR A, which is why BIND (and maybe R53) has the "randomize A records" functionality.

Re: NGINX open sources TCP load balancing

#79
post #72
post #14

Many installations would go from haproxy->nginx to nginx->nginx. Having to support a single product will make many devops happy. In the same tense, haproxy is adding Lua support[1], which has been available in nginx - using openresty[2] - since 2011, and nginx core is doing the same with Javascript[2]. Interesting times aroung haproxy and nginx. [1] http://blog.haproxy.com/2015/03/12/haproxy-1-6-dev1-and-lua/ [2] htt…

Not to mention the vast ecosystem of some really great nginx plugins. The one thing I have found desperately wanting in both nginx and haproxy is the support for real-time stats and filtering found in Varnish (supports HTTP only). I am absolutely hooked! // Query Times varnishncsa -F '%t %{VCL_Log:Backend}x %Dμs %bB %s %{Varnish:hitmiss}x "%r"' // Slow Queries varnishncsa -F '%t %{VCL_Log:Backend}x %Dμs %bB %s %{Varn…

I've been able to get real-time stats in nginx by adding custom counters with the lua plugin and exporting a stats handler.

http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT

Re: NGINX open sources TCP load balancing

#80
post #47

Earlier quoted context omitted.

Not sure about that... HAproxy is a proven technology (very reliable and a joy to use at that) in this field while Nginx is a newcomer and needs to establish its credibility first. I personally wouldn't use such technology for load balancer until it is properly battle-tested. Also, I can't see much of an advantage over (proven) HAproxy - am I missing something? As for supporting a single product, I don't see the poin…

HAProxy offers a better DDos mitigation configurables in comparison to nginx. Thats it.

CloudFlare is build on top of OpenResty which is basically stock nginx with ngx_lua and a bunch of other modules built in. I would argue that if you want it to be, nginx can be much better at DDoS mitigation. You can use the modules limit_conn and limit_req to control how many connection individual IPs can make to your server for basic control.
Post reply on HN