Please consider this HAProxy configuration with sticky sessions using JSESSIONID
defaults
timeout server 5m
frontend http-in
bind *:80
default_backend servers
backend servers
option httpchk OPTIONS /
option forwardfor
option http-server-close
appsession JSESSIONID len 52 timeout 30m
server ut1 192.168.123.101:8080 minconn 100 maxconn 8000 check inter 5000
server ut2 192.168.123.102:8080 minconn 100 maxconn 8000 check inter 5000
server ut3 192.168.123.103:8080 minconn 100 maxconn 8000 check inter 5000
server ut4 192.168.123.104:8080 minconn 100 maxconn 8000 check inter 5000
server ut5 192.168.123.105:8080 minconn 100 maxconn 8000 check inter 5000
server ut6 192.168.123.106:8080 minconn 100 maxconn 8000 check inter 5000
Approximately 95% of the sessions correctly stick to the backend server. While 5% switches backend server. I have no clue why.
Is there any configuration setting I can use to prevent this behavior?
Is there a way to receive alerts when a sessions switches backend server?