Hi,

2015-06-26 14:59 GMT+02:00 Willy Tarreau <[email protected]>:
> Hello,
>
> On Fri, Jun 26, 2015 at 02:49:23PM +0200, ??ukasz Tasz wrote:
>> Hi all,
>>
>> I found haproxy as a really nice load balance tool.
>> I setted up 100 machines as a part of backend, every machine max 8
>> connection, least alghoritm, tcp mode -works perfect!!
>>
>> But this 100 machines is a part of cloud, so It is possible that some
>> machine will got replaced, or simply I would increase number of
>> machines in backend.
>>
>> And here problem is comming,
>>
>> When I do reload, new haproxy process is not aware about current
>> connections - counters are reset, and backend hosts are receiving more
>> than maximum 8 connecitons.
>
> Yes. 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.


>> 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?


regards
Lukasz

>
> Cheers,
> Willy
>

Reply via email to