Hello,

I'm trying to add a feature which allows HAProxy to use more than one
source when connecting to a server of a backend. The main reason is to
avoid duplicating the 'server' lines to reach more than 64k connections
from HAProxy to one server.

So far I thought of two ways:
    - each time the 'source' keyword is encountered on a 'server' line,
      duplicate the original 'struct server' and fill 'conn_src' with
      the correct source informations. It's easy to implement but does
      not scale at all. In fact it mimics the multiple 'server' lines.
      The big advantage is that it can use all existing features that
      deal with 'struct server' (balance keyword, for example).
    - use a list of 'struct conn_src' in 'struct server' and 'struct
      proxy' and choose the best source (using round-robbin, leastconn,
      etc...) when a connection is about to get established.

The config. syntax would look like this:

server srv 127.0.0.1:9000 source 127.0.0.2 source 127.0.0.3 source 127.0.0.4 
source 127.0.0.5 source 127.0.0.6 source 127.0.1.0/24

Not using ip1,ip2,ip/cidr,... avoids confusion when using keywords like
usesrc, interface, etc...

Checks to the server would be done from each source but it can be very
slow to cover the whole range.

The main problem I see is how to efficiently store all sources for each
server. Using the CIDR syntax can quickly allow millions of sources to
be used and if we want to use algorithms like 'leastconn', we need to
remember how many connections are still active on a particular source
(using round-robbin + an index into the range would otherwise have been
one solution)
I have some ideas but I would like to know the preferred way.

Thanks.

-- 
Aurélien Nephtali

Reply via email to