On Fri, Jun 26, 2015 at 04:25:35PM +0200, ??ukasz Tasz wrote:
> > If this is something acceptable in your case (I don't know), you
> > have two restart options, one consisting in letting the old process
> > continue to process existing connections, and one where the old process
> > will simply kill all connections so that they're handled by the new
> > process. I don't know which one is best for you, given that it solely
> > depends on the services on top of tcp.
> >
> 
> Breaking connection is not acceptable.
> hands-off reload is working, no connection is killed, but new
> connection might be not handled properly.
> e.g
> - hosts in backend = 100
> - each host can handle 1 connection - service is making heavy tasks
> - 50 machines are busy
> - reload with hands-off
> - after reload I added 20 machines more, now I have 120 machines in backend
> - new connections are commig, haproxy goes "alghoritm least" but is
> not aware about old still alive connections,
> so it might happen that new connection will go to machine that already
> exceed connection limit.

Oh yes don't worry, I'm seeing the problem pretty well :-)

> >> I dont't want to go deeper describing my services. I'm  just wondering
> >> If I missed something in my configuration?
> >>
> >> Or simply haproxy is not designed to work with dynamic backend?
> >
> > If the only reason why you reload is because a server gets a new address,
> > then in 1.6-dev2 you have an option to dynamically resolve DNS names so
> > that you don't need to reload anymore when an IP address changes. We're
> > interested in getting feedback about this, so it might be a good 
> > opportunity.
> 
> This I already tried in 1.5 but dns was not accepted :) so you mean
> that config might look like:
> 
> listen myservice :3636
>     mode    tcp
>     balance leastconn
>     server haproxy_name1 probably_host_exists1.haproxydomain:8098
> check maxconn 8
>     server haproxy_name2 probably_host_exists2.haproxydomain:8098
> check maxconn 8
>     server haproxy_name3 probably_host_exists3.haproxydomain:8098
> check maxconn 8
>     server haproxy_name4 probably_host_exists4.haproxydomain:8098
> check maxconn 8
> .
> .
> .
> .
>     server haproxy_name200 probably_host_exists200.haproxydomain:8098
> check maxconn 8
> 
> and inside /etc/hosts I can dynamically enable/disable host?

Not enable/disable yet, but resolve yes. You'll need to specify "resolvers"
on each server line and check section 5.3 in the doc. In order to disable
them you can simply make them point to an invalid address such as
255.255.255.255 if you want, the check will fail and the server will
remain down. That way you can pre-populate your config.

Regards,
Willy


Reply via email to