1

Rules:

  1. We have 4 backend machines behind a HAproxy server.
  2. One client opens 4 long-lived tcp connections.
  3. We have two clients.
  4. Each client should have 1 long-lived tcp connection per backend machine.
  5. No specific IP addresses of clients should be Used.

Is it possible to have such a setup using HAproxy?

I have tried and the problems are:

If We Use leastcon balancing algorithm on 1 client it works perfectly.

If We use leastcon balancing algorithm on 2 clients, the connections distribution on the backend nodes won't allways verify the rule number 2

If We use different backends with the same backend machines, and create acls on source IP to group connections coming from the same client, and forward them to the diffrent backends using leastcon balancing algorithm, It works perfectly, but we are not respecting rule number 5.

Does anyone have better ideas?

Ezwig
  • 111
  • 2
  • Loadbalancing is usually a numbers game, where *eventually* each backend will get the desired fraction of the load you're balancing. With very small numbers *your intuitive understanding* of how the load *should* be distributed is much more likely to disagree with how an algorithm will distribute the load in practice. (And if you need a completely deterministic distribution, then you most likely need to configure that explicitly) – Bob Nov 20 '20 at 16:53
  • @HermanB, Thank you for your comment. I think It is possible to reach the desired setup because I did It, I just want to make the proxy agnostic to src IP addresses, just grouping based on src IP without specifying exactly what src IP it is. – Ezwig Nov 23 '20 at 10:51

0 Answers0