On Thu, Sep 12, 2013 at 02:33:10PM -0700, Michael Lasevich wrote:
> 
> On 9/12/13 1:34 PM, Willy Tarreau wrote:
> > I'm sorry but I still don't understand what you're trying to achieve.
> > Having *two* default backends makes no sense, how would we decide
> > which one to use ? If they're both to be used, simply merge both
> > servers :-/ Regards, Willy 
> Now, if only HAProxy had load balancing capabilities... ;-)
> 
> Basically I need multiple frontends - some go to one backend, some to
> another, some to both. This is easy if you duplicate servers into a
> third backend as you say - but then you have two sets of maxconn -
> meaning you no longer have ability to effectively limit max overall
> sessions to each server.
> 
> A specific example is a search server that serves public and private
> data for some customers.  A query for public data returns only public
> data, but a query for private data returns private data+public data. Now
> private queries are directed to the cluster the data is at - but public
> queries can be handled by ANY of the servers. Makes sense now?

Yes I get it now, thanks for explaining. I've seen very similar cases
a number of times, and it was always addressed the same way : the
maxconns are reduced in the backends to ensure that their sum does
not surpass the real server's maxconn. It is even possible that in
your case there are far less private requests than public ones, meaning
you can only slightly reduce the maxconn on the public servers.

I know it can sound like you're limiting the server's capacity by
reducing the maxconn value but in practice this is not the case, as
you'll observe that you get the exact same performance with a wide
range of maxconn values.

So probably something like this will do exactly what you want,
assuming you're running with maxconn 100 on your servers :

   frontend pub
      use_backend all

   frontend pri
      use_backend pri

   backend all
      server pub1 1.1.1.1 maxconn 90 check
      server pub2 1.1.1.2 maxconn 90 check
      server pri1 1.1.2.1 maxconn 90 check
      server pri2 1.1.1.2 maxconn 90 check

   backend pri
      server pri1 1.1.2.1 maxconn 10 track all/pri1
      server pri2 1.1.2.2 maxconn 10 track all/pri2

Another concern I'm having with your description, but that is very
specific to your usage, is that I find it strange to let public users
access private servers to retrieve public data. I don't know what
prevents your public users from retrieving private data this way :-/

Regards,
Willy


Reply via email to