Is it possible for HAproxy to reload its configuration at runtime, without dropping existing connections?

I've looked high and low in the documentation for some mention of this but have been unsuccessful. Does anybody know off hand?

Thanks.

link|improve this question

33% accept rate
feedback

1 Answer

up vote 2 down vote accepted

I am not sure about how perfectly this handles a reload, but the command line option for this to haproxy is -sf:

-sf Send FINISH signal to the pids in pidlist after startup. The processes which receive this signal will wait for all sessions to finish before exiting. This option must be specified last, followed by any number of PIDs. Technically speaking, SIGTTOU and SIGUSR1 are sent.

This is what the reload argument does in my Ubuntu init scripts:

haproxy_reload()
{
        $HAPROXY -f "$CONFIG" -p $PIDFILE -D $EXTRAOPTS -sf $(cat $PIDFILE) \
                || return 2
        return 0
}
link|improve this answer
I've just noticed that the docs for v1.2 contain a lot more detail around this subject: haproxy.1wt.eu/download/1.2/doc/haproxy-en.txt But the docs for v1.4 seem to have removed all references to it! Confusing... – NathanE Feb 26 '11 at 17:30
Turns out that /etc/init.d/haproxy reload is sufficient :) Seems that newer versions have got this so well catered for on a stock install that the extensive documentation for it in previous versions is no longer required. – NathanE Feb 27 '11 at 18:48
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.