"hash" director and app cookie

Cédric Jeanneret varnish at tengu.ch
Wed Jun 24 12:54:47 CEST 2015

On 06/24/2015 10:32 AM, Dridi Boukelmoune wrote:
> On Wed, Jun 24, 2015 at 10:15 AM, Cédric Jeanneret <varnish at tengu.ch> wrote:
>> How may I do that? using a simple "curl" doesn't show any
>> load-balancing, as I'm hitting always the same instance. I'm pretty sure
>> this is due to client.identity — how may I fake it?
> Hi,
> Have a look at varnishtest for faking it, you can make your backends
> reply with a hardcoded header and check that on the client side.
>> I didn't find any documentation regarding this object, and reading
>> source-code in order to know a bit more isn't really the easiest way to
>> understand what's done.
> See the documentation at the bottom:
> https://www.varnish-cache.org/docs/4.0/reference/vmod_directors.generated.html#backend-hash-backend-string-list
> The hash director doesn't rely on client.identity anymore, but on
> whatever you want to use to route the traffic.
> Cheers,
> Dridi
>> Thanks for you help!
>> Cheers,
>> C.

Hello Dridi,

Thanks, I think I was just not awake, I'm pretty sure I'll be able to do
what I need, I was focused on the application cookie instead of just
thinking "the POST for login will be redirected to the statefull
backend, as well as the other so long there is a cookie matching a
certain pattern, hence we're using the hash director from the very
beginning, hence no issue at all".

This should do the trick hopefully, and I'll see how to fake the "thing
that identify my query" in order to ensure it goes on different hosts.



More information about the varnish-misc mailing list