We restart our haproxy instances with the following command line:

haproxy -f /etc/haproxy.cfg -p /var/run/haproxy-private.pid -D -sf
<contents of pid file>

This works but we find that the new haproxy process uses a lot of cpu
(100% of one core) for about 20 seconds after the restart. During this
time it looks as if various queues fill up and haproxy logs fewer
requests than normal. Once the cpu load drops we get a surge of
requests (which cause a spike in connections to our db, and a raft of
other problems if we do this during heavy traffic).

I've read about -sf and -st in the man page but I'd like to understand
more about what happens when starting haproxy with one of these
options.

For example, one theory we have is that the old process immediately
closes its connections and stops listening for new connections. This
would cause all of our clients (browsers) to create a new connection
for their next http request) which might force haproxy to do a lot of
cpu work for each new connection (we are using haproxy 1.5-dev15 to do
ssl in haproxy).

Is this plausible? Is there anything else we should investigate?

Reply via email to