Websockets and stuck processes


#1

We’re using haproxy to balance both http/https traffic and some websockets. The websockets are present, but when we try to do a graceful restart (/usr/sbin/haproxy -D -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -L LB1 -sf 4037) the process gets hung (But a new haproxy instance starts) until we manually close the inbound connections that are connecting to the websockets.

This will become problematic as we restart haproxy multiple times to pick up new dynamic configuration (integrated with consul using consul-templates to dynamically provision backends) and the old process won’t die until the websocket is closed on the other side, so we end up having many, many processes going.

Any recomendations on how to fix this?

HAProxy version 1.5.14


#2

I’ve ran into stuff like that before… Basically a graceful reload deliberately does this to well keep it graceful… It’ll keep the old process around until all ESTABLISHED conns have finished using it.

Maybe you don’t really need a graceful reload at all? What is the affect to the users when you close the inbound connections, do they re-connect to the new haproxy process without causing user issues?