I am trying to load balance a load balancer (HAProxy). Meaning i want to create a load balancer cluster/farm.

The farm would use different bindings/rules to load balance requests differently based on the rules to several other clusters with different purposes.

I cant seem to find much info on the topic, all i find is active-passive setups with just 2 instances... I need to plan for many of them, not only 2. Then I came accross this post: http://www.serverphorums.com/read.php?10,672865

which mentions:

HAProxy can share as of 1.5 its connection table, which is really a appreciated feature :)

I plan to use a Firewall with load balancing capabilities (Fortinet) to balance requests to active HAProxy instances which then in turn would load balance the requests accordingly.

So Is there a way that the connection table can be shared amongst the instances so that I can achieve true active/active load balance of the HAProxy itself?

Is there a better way?

  • You are not specifying what you want to achieve exactly. The "connection table" is mostly for sharing session stickiness for stateful apps. I would argue that a normal setup for haproxy is active/passive since I never used it active/passive. Just throw connections to multiple nodes, what does it matter? Is your application stateful? – Florin Asăvoaie Aug 29 '16 at 19:32
  • As mentioned this will be for a cluster of HAproxies which i plan to use for many "tasks" rather than having a separate cluster per "task". Some of them will indeed be stateful while others not. – Onitlikesonic Aug 29 '16 at 19:59
  • Then just use the session tables replication in haproxy for the stateful tasks. There's nothing else you need. – Florin Asăvoaie Aug 29 '16 at 20:02
  • Why do you plan to use more than two nodes ? Active/passive setup has the only purpose - to make it redundant in case of a hardware failure. The need to scale the balancer comes from a fact that they aren't able to handle the load. Is this your case already ? I guess not. – drookie Aug 30 '16 at 5:21
  • This is not our case currently but this is exactly the case i want to analyze (only two not being able to handle the load) – Onitlikesonic Aug 30 '16 at 11:33

So you need a contingency for your HAproxy?

You should use a floating IP, and it depends on your cloud infrastructure (may you need the help of your hosting provider).

That's the only way to break-out of the point of failure of a single load balancer:

enter image description here Image source: digital ocean

If the primary load balancer down, a secondary will automatically assume to keep serving requests.

It is important to note that the Floating IP does not automatically provide high availability by itself; a fail-over mechanism, which automates the process of detecting failures of the active server and reassigning the Floating IP to the passive server, must be devised and implemented for the setup to be considered highly available. There are some open-source solutions to fit this necessity such as http://www.keepalived.org that provides failover capabilities if the primary load balancer becomes unavailable.

May this article could help: https://www.digitalocean.com/community/tutorials/how-to-set-up-highly-available-haproxy-servers-with-keepalived-and-floating-ips-on-ubuntu-14-04

  • 1
    This is a good suggestion and one we already evaluated and probably will follow however i was mostly looking for information on how to replicate the connection table at this point. – Onitlikesonic Dec 8 '17 at 12:54

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.