Sticky Load Balancing with Varnish

Niklas Norberg niklas.norberg at bahnhof.se
Wed Apr 14 20:13:39 CEST 2010


> ons 2010-04-14 klockan 16:00 +0000 skrev Poul-Henning Kamp:
> In message <1271248091.5141.33.camel at app-srv-debian-amdmp2.idni>, Niklas Norber
> g writes:
> 
> >So I also vote for keeping this as a documented configuration rather
> >than a built-in feature. Unless the planned sticky load balancing will
> >have something above the rudimentary.
> 
> Check the "hash" and "client" directors in 2.1, depending on what
> you want to be "sticky" based on (object or client)
> 

Thanks (but...),

Does the hash director balance differently, in the big picture, than the
already existing random director?

The client director comes close to my intended setup but the problem
with balancing on client ip is, as have been mentioned before, that lots
of clients (real users behind their browsers) can share the same
ip-adress. I worked with a site where the end users were schools and
8.30 the traffic always got high and the ip-adresses were too few to
balance on, so we did it in the hardware load balancer on level 7 (i.e.
with a cookie).

As I see it there are only two cases:
* Either we want to have sticky (ip or cookie) for the traffic that has
uses session cookies, because in this case it is costful to hit the
wrong backend (session redundancy costs performance (and setup hours).
or
* It's stateless traffic and therefor it can be distributed randomly. In
this case preferably with weights (if the backends differ) and with
traffic memory according to:
http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html#traffic

It is of course good if they can be combined as one for example easily
can do with VCL in Varnish.

As I can figure these two covers all, or?

So the question is, are there any plans for any traffic based
director? :)


Best Regards

Niklas Norberg







More information about the varnish-misc mailing list