Strategies for splitting load across varnish instances? And avoiding single-point-of-failure?

Michael Fischer michael at dynamine.net
Sat Jan 16 03:14:43 CET 2010


On Fri, Jan 15, 2010 at 5:33 PM, pub crawler <pubcrawler.com at gmail.com>wrote:

Varnish performs very well.  Extending this to have a cluster
> functionality within Varnish I think just makes sense.


haproxy and F5 equipment also both perform very well.


> The workaround
> solutions so far seem to involve quite a bit of hardware as well as
> having a miss rate of 50% in example of 2 Varnish instances.  Sure it
> can hot populate fast, but it's two stacks of memory wasted for the
> same data per se.


If you hash your requests from a load balancer across a pool of n varnish
instances, the most you lose in the event of a failure is 1/n.  You don't
cache objects in more than one instance.  There's no "wasted" memory.

 I suppose a custom solution to hash the inbound
> requests somehow and determine which Varnish should have the data can
> be done, but unsure if anyone now is doing that.
>

That's precisely what L7 switches do.  As David said, haproxy has this
functionality, as do other implementations.


> Squid is a total disaster.  If it wasn't none of us would be here
> using Varnish now would we :)  It's amazing Squid even works at this
> point.
>

Can you quantify this statement?  Squid works very well at some
installations.

It's not like the code that was out there working spontaneously started to
become buggier.


> I put in a feature request this evening for this functionality.  We'll
> see what the official development folks think.  If it can't be
> included in the core, then perhaps a front-end Varnish proxy is in
> order developmentally.  I'll say this akin to Moxi in front of
> memcached instances: http://labs.northscale.com/moxi/


I'm all for putting backend hashing into Varnish for the purpose of routing
requests to backends based on a consistent hash of the request parameters --
and there's no reason why the backend can't be another Varnish instance.
 But the appropriate use of this is to more efficiently utilize cache memory
by associating an object with a designated Varnish server in a pool, not for
HA.  This was one of my first requests that still (alas) has seen no
traction.

--Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20100115/692567f1/attachment-0001.html>


More information about the varnish-misc mailing list