Tying into Mehdi,

I’ll share with you what we do at our organization which works pretty well. For 
one, we have two haproxy servers that run keepalived. That way if we need to do 
something invasive we have a backup to handle the traffic. The process to flip 
to that server has minimal impact and more could be done to lower that.

Secondly a method of using reload for your server configuration would also 
benefit greatly to assist with this. Gracefully reloading haproxy would allow 
one to handle on-going connections until they end, and bring online the new 
server gracefully with minimal impact. Here’s an example haproxy init 
script<http://www.haproxy.org/download/contrib/haproxy.init.el5> that supports 
reload.

Haproxy does not automatically reread his configuration file without some sort 
of signal being sent to him. Even other solutions used by some other services 
use the above approach to dynamically configure haproxy appropriately.


--
John Skarbek


On February 18, 2016 at 09:25:54, Mehdi Ahmadi 
([email protected]<mailto:[email protected]>) wrote:

A `restart` - is naturally an unconditional step thats required - especially in 
cases of new backends or server additions therein - which are not trivial 
changes. Network loss / disturbance - if any - is negligible as any existing 
connections should be migrated between process with a minute window (relative 
to host) where new connection may not get a response, etc - though 
realistically in most modern x64 hosts and environments we're talking of < 10ms 
(least in my own case).

What may be a better option for you to consider is - having backup server 
instances / routes predefined that you can then adjust or change dynamically 
and perhaps even better control via `acl` related clauses which can also be 
changed dynamically without having to do a restart.

This procedure can also work for load elastication - for example where you'd 
have at least 100% / duplicate number of server instances in each backend;  
also a similar approach may server for later fail-safes that have not yet been 
spawned or running but at least have a predefined route which can be adjusted 
with appropriate checks and server weighting without any further restart.

I hope I've not misinformed you in anyway.


On Thu, Feb 18, 2016 at 3:07 PM, 
<[email protected]<mailto:[email protected]>> wrote:
Hello,

What is the best way to dynamically add a new backend server (cluster node) 
without causing traffic disruptions? In other words, after adding a new 
'server' line to backend section. Merely saving the configuration file does not 
seem to cause HAProxy to re-read the configuration. My HAProxy runs as a 
service.

Thank you
Alex

Reply via email to