Howdy All,
I wondered if anyone could entertain me with some ideas and thoughts
on being able to load balance all connections that pass through
HAProxy, perhaps by using more that one method, to "catch all"
connections (I have a single box set up in mind which is troubling
me). I have placed a snippet of the config below. We are inserting a
cooking to the request, either s1 for server1 or s2 for server2 so
that customers are having sticky sessions with the web servers. For
customers that don't support cookies, the servers redirect the user to
a different URL that carries the session ID in the URL all throughout
the session (an SSL session is terminated in front of HAProxy, so
HAProxy is HTTP only below).In the cookie-less scenario we would like
to use source IP based balancing; whilst this isn't the most even
distribution of traffic, it will be a minority of traffic.
So, can I enable two balancing techniques? Is there a way of having
priority based balancing so cookies are preferred, failing that,
source IP? If not, what do others do if you want to use balancing
method A, but some clients might not fit into the criteria for that?
Cheers,
James.
global
log 127.0.0.1 local0 notice info
user haproxy
group haproxy
daemon
stats socket /var/run/haproxy/haproxy.sock mode 0600 level admin
defaults
log global
mode http
option httplog
option dontlognull
retries 3
maxconn 10000
contimeout 5000
clitimeout 50000
srvtimeout 50000
listen https-iis-servers 127.0.0.1:80
cookie apps insert
option persist
option redispatch
# Active WebApp servers
server server1 192.168.1.1:80 cookie s1 check inter 2000 rise 3 fall 3
server server2 192.168.1.2:80 cookie s2 check inter 2000 rise 3 fall 3
balance source