Reload haproxy.cfg without restarting

Reload haproxy.cfg without restarting

Posted on 16. Nov, 2009 by forouzani in System Administration

When you make adjustments to the haproxy configuration file (haproxy.cfg), you need to restart the load balancer before the new configurations take effect. For a high traffic site, this is a painful process – any downtime is noticable by the users. There is a way to reload the config file gracefully, without causing interruption to users – but this is hidden in the great txt based documentation for haproxy. For your delight, here it is:

# haproxy -f /etc/haproxy.cfg -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid)

All you need to do, is make sure you pass in the correct location for the haproxy configuration file, and the pid.

Tags: , ,

Leave a Reply