TCP Proxy, dual-redundant partitions and least connection balancing

From: Jacques <whshub#gmail.com>
Date: Wed, 11 Nov 2009 22:16:38 -0800


Hello,

I'm new to HAProxy and am trying to setup a TCP balancing of services using 'shared' least-connection balancing and was wondering if this was possible with HAProxy. We're partitioning our services across multiple servers and want to use a 'dual-redundant' type approach to distributing load. Each service will be located on at least three servers. This will allow us to manage server failure and maintain a higher peak rate than a more traditional mirrored redundancy arrangement.

Basically, my goal is as follows:

4 servers each house three services

server 1 : service a, b, c
server 2 : service b, c, d
server 3 : service a, c, d
server 4 : service a, b, d

service a is on port 9020
service b is on port 9021
service c is on port 9022
service d is on port 9023

If server 1 goes down, I want the load to be evenly distributed between the other three servers across services. E.g. I want the least connections balancing counts to include all services, not just one particular service. For example, if we are maintaining the following connection counts: 300 for a, 600 for b, 900 for c and 300 for d, we would have the following up and down states (example distribution, others are possible):

_Up State_

server 1 : a (100), b(150), c(275) = 525
server 2 : b(125), c(300), d(100) = 525
server 3 : a(100), c(325), d(100) = 525
server 4 : a(100), b(325), d (100) = 525


_Down State A_ (after stabilization period)

server 1: down
server 2: b(150), c(450), d(100) = 700
server 3: a(150), c(450), d(100) = 700
server 4: a(150), b(450), d(100) = 700

_Down State B_ (after stabilization period)

server 1: down
server 2: down
server 3: a(75), c(900), d(75) = 1050
server 4: a(225), b(600), d(225) = 1050


There is some complexity here that isn't warranted at 4 servers but the redundancy model allows us to do a number of useful things. Also, while the example has each service existing the same number of times, in reality the number of copies of a service would vary depending on other factors (load, response curve, etc).

Is this possible out of the box with just a configuration file?

thanks for any guidance,
Jacques Received on 2009/11/12 07:16

This archive was generated by hypermail 2.2.0 : 2009/11/12 07:30 CET