I was asked how to get haproxy to reload its configuration file, and not 
disturb any existing connections.  For example, if I have two servers listed, 
and I want to take one out for maintenance.

I wasn't sure about the difference between -sf and -st, but from reading 
2.4(.1), I'm guessing -sf is the better way.  It allows all existing 
connections to finish, then temporarily stops/pauses all services(?), rereads 
the configuration file, then restarts again?

What if an existing connection is a very long one (say returning a large amount 
of data from a LDAP or database query)?  It could, potentially, cause haproxy 
to stay not-listening (the logs say Pausing proxy XX) for a while.  But I'd 
rather not assume that's going to happen and do a -st and kill all existing 
connections, just so I won't necessarily get stalled waiting for one long 
connection to finish.

It appears SIGUSR1 is the clean way to gracefully shut down haproxy completely.

I guess is there a way to have it reread the file, note the differences, and then go from 
there?  For example, if the only thing I've done is comment out 
"dontlog-normal", there's really no reason  for haproxy to TTIN+USR1/TTOU 
anything.  And if the only thing I've done is add-back a previously removed server or 
remove a server about to go into maintenance, there's really no reason again for haproxy 
to necessarily completely stop listening on its ports, it just needs to start (or stop) 
sending connections to the added/removed backend server.

I also noticed it appears as doing the -sf stops all services temporarily until 
the reload is done, etc.  If I have multiple services, and I only changed one 
of them, there's no reason for Haproxy to pause all the services.

PH
--
Paul Hirose          : [email protected] : Sysadm Motto: rm -fr /MyLife

Reply via email to