Hi Rajat,

On Fri, Mar 28, 2014 at 07:40:45PM -0400, Rajat Chopra wrote:
> 
> 
> > 
> > Haproxy 1.5 and earlier cut the lines in words around spaces, so above your
> > expression does not work because it's split in two. Just remove the space
> > before "map" and it will do exactly what you need. Also I think it's better
> > to use a map than the plain header because this way you can ensure what the
> > exact list of accessible backends will be, and you can also get rid of some
> > matching details such as lower/upper case etc...
> 
> Thanks for the pointer. Removed the space, and it works.

Cool.

> > But maybe
> > this would make the config more complex in the end, I don't know. I think
> > the natural next step is the "usedst" server directive that people who want
> > to run proxies are requesting :-)
> 
> I generate the configuration through a script, so I guess not much difference
> unless you think it is more optimal to run single-server backends by grouping
> them.

No from this point it will not change much. The only point I'm seeing is that
if you have few backends with multiple servers, you could enable health checks
on them and not on the other ones which have a single server. That could make
it easier to generate the config (checks vs no checks).

> On the other hand, it appears cumbersome when such host-servers start to
> scale-up and we have to move it from being a stag server to an actual backend
> for load-balancing.

That's a good point, so maybe it's not a good idea indeed.

> Not sure I understand the usedst directive. Dynamic lookup of server's target 
> destination?

Yes, we already have "usesrc" on the servers which is used for transparent
mode. At the moment, usesrc supports only client/clientip/hdr_ip() to force
the source address of outgoing connections and will sooner or later support
a valid expression. "usedst" will be the same to force the destination based
on an expression. The main gain is to save memory and load time by having
fewer servers for such configurations.

Cheers,
Willy


Reply via email to