I wondered what algorithm is used for the "source" load balancing option?
The reason for the question is due to wanting to load balance a service
that uses both TCP and UDP traffic... where the TCP and UDP must go to the
same back-end.
For TCP we are currently using HAproxy and simply drop the UDP traffic as
this is optional for the application (Microsoft RD/TS Gateway), but UDP can
improve interactive performance for remote RDP connections passed to the RD
Gateway.
My plan was to use LVS/keepalived for the UDP traffic but I was unsure if
the "source" option in HAProxy and the "sh" (source hash) scheduling
algorithm in LVS would yield consistent results.
The documentation for the "sh" algorithm in LVS notes the following
pseudo-code:
n <- servernode[src_ip];
if (n is dead) OR
(n is overloaded, such as n.conns>2*n.weight) then
return NULL;
return n;
With the servernode array describe as "a 256-bucket hash table that maps
the hash index derived from packet source IP address to the current server
array".
Based on this would I expect the "source" balance option in HAProxy and the
"lh" selection algorithm in LVS to return a consistent back end?
Or should I simply use LVS for both connections (TCP and UDP)...although
HAProxy does other things on this device already...and is reasonably well
understood by our team...hence the desire to use HAProxy where possible.
--
Andrew Heberle