Our application requires cookie based sticky sessions, so we want to use HAproxy to balance incoming traffic towards a farm of IIS servers.
We are using the following config which seems to work on the lab (round-robin working fine and session preserved), but fails when applied in producion with more that 3k concurrent users:
frontend Front_http
bind :80
mode http
default_backend backend_http
stats enable
capture cookie ASP.NET_SessionId len 32
maxconn 10000
frontend Front_https
mode http
default_backend backend_https
bind *:443 ssl crt /etc/haproxy/cert.pem
capture cookie ASP.NET_SessionId len 32
maxconn 10000
backend backend_http
balance roundrobin
option forwardfor
stick-table type ip size 20k expire 5m
appsession ASP.NET_SessionId len 64 timeout 5m request-learn prefix
server Server_1 192.168.10.81:80 cookie Server_1
server Server_2 192.168.10.81:80 cookie Server_2
server Server_3 192.168.10.81:80 cookie Server_3
backend backend_https
balance roundrobin
option forwardfor
stick-table type ip size 20k expire 5m
appsession ASP.NET_SessionId len 64 timeout 5m request-learn prefix
server Server_1 192.168.10.81:80 cookie Server_1 ssl verify none
server Server_2 192.168.10.81:80 cookie Server_2 ssl verify none
server Server_3 192.168.10.81:80 cookie Server_3 ssl verify none
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }
From the HAProxy 1.5.8 documentation I understand cookie based stickiness is achieved with command "appsession", but I don't understand the role other commands play, like "capture cookie" or "stick-table", are they necessary at all when using appsession? Can anyone help me understand how they work, and advise if you detect anything wrong with our config.