I'm trying to found a way to restart HAProxy without clearing all my counters. I've tried the hot reconfiguration, but neither of the following commands seems to work:

haproxy -f /path/to/haproxy.cfg -p /path/to/haproxy.pid -sf $(cat /path/to/haproxy.pid)

haproxy -f /path/to/haproxy.cfg -p /path/to/haproxy.pid -st $(cat /path/to/haproxy.pid)

Both commands reload the configuration but my counters are still being cleared. Perhaps this is not possible?

2 Answers 2


A reload is effectively a fancy way of creating a new processes. In HAProxy, stats are kept in each process only and are never persisted anywhere. This is because HAProxy typically chroot's into an empty directory where it can't write anything to. So there is no way to inject stats / counters into new processes.

This btw. is also an issue you will face when you set nbproc > 1. As each processes keeps it's own stats, counters and sticky tables, it's pure chance at which process you end up and which process's counters you observe. These things can not be shared. (apart from sticky tables, where there is a protocol, but I believe this still doesn't work well with nbproc)


What version are you running? I believe 1.4 has the option to keep counters across restarts.

  • That's probably the issue, I'm running version 1.3. Jan 29, 2011 at 17:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .