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

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?

share|improve this question
add comment

2 Answers

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)

share|improve this answer
    
Thank you very much –  Leandro López Mar 29 '11 at 2:24
add comment

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

share|improve this answer
    
That's probably the issue, I'm running version 1.3. –  Leandro López Jan 29 '11 at 17:24
add comment

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.