On Thu, 2010-12-09 at 14:28 +0100, Willy Tarreau wrote:
> Hi Andreas,
> 
> On Thu, Dec 09, 2010 at 02:00:30PM +0100, Andreas Kohn wrote:
> > Ok,
> > 
> > attached a set of patches that allows an admin user to add and remove a
> > server from an existing backend using the stats interface.
> > 
> > The use-case we have for this is that we have a lot of servers that come
> > and go (amazon cloud environment with automatic scaling), and to add
> > them to a haproxy we want to avoid restarts of the haproxy.
> > 
[...]
> > 
> > I currently have open "issues" with this:
> > 1) is the adding doing the right things in terms of putting it in
> >    in the struct proxy and setting it up? 
> > 2) I still need to check what other structures need to be free()'d
> >    when removing a server
> > 3) is there any kind of locking requirements if requests come in while
> >    a server is added/removed?
> > 
> > 
> > What do you think? 
> 
> I still have a problem with doing that because I don't see how you can
> easily fix some parameters that are determined at config time :
> 
>   - the size of the LB map for hash/static-rr is determined as the sum of
>     the servers' weights divided by their GCD. Adding a server or changing
>     even one weight will result in a change of the map size. This must be
>     reallocated and recomputed.

Indeed, need to look into that I guess. The tests I did so far were only
with a single server, and there was a disabled server in the config for
another test. 

>   - the number of file descriptors is set to the total amount of required
>     sockets (listeners, client, server, pipes, checks). If you add servers,
>     you will need more sockets to run the checks, but you don't have the
>     required privileges anymore to change the ulimit. That means that
>     connections or health checks may randomly fail when working close to
>     connection limit if some servers are added.

Hmm. One quick way around that could be to statically configure a number
of extra file descriptors as "slack" in the backend options. 
Usually we don't add an excessive new amount of servers without removing
similar amounts of other servers, so we should be able to estimate
maximum/average numbers.

But I definitely should check this, and refuse the addition if the limit
is reached. In that case the caller could fall-back to restarting the
haproxy instance with a higher maximum.

>   - what happens when you remove a server that is being tracked or referenced
>     by an ACL ?

We don't use those features, so I fear my answer would be a clear "I
don't know". Will have a look.


I hope that the patches in the current state could be helpful already
for looking at them, but most certainly they should be flagged "highly
experimental". I'm still learning how haproxy works internally :)

Regards,
--
Andreas


> Thanks,
> Willy

-- 
Never attribute to malice that which can be adequately explained by
stupidity.                                        -- Hanlon's Razor

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to