Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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
}
share|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... –  nbevans 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. –  nbevans Feb 27 '11 at 18:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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