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

Bendik Heltne bheltne at gmail.com
Sat Jan 16 10:54:27 CET 2010


> 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.

I must say that i am a bit confused.
I don't understand the need of routing requests to different varnish
servers based on hash algorithm. So I am wondering what kind of sites
are we talking about?
If we talk about huge sites with a lot of traffic I find it strange
that hardware costs are so problematic.

The most common scenarios is that you want load-balancing and/or redundancy.
Routing request to different servers will cause you to loose
redundancy unless you add extra servers wich again will cost more than
upgrade disk or RAM.
If you have shared cache you will also loose redundancy unless you
compansate on some ways.

If you have a small site you could easily get both redundancy and
loadbalancing by running HAProxy and Varnish on 2 or 3 servers with
failover using Hearbeat or something else (I must admit that i am not
familier with HAProxy, so it may support failover out of the box).

Our Varnish servers have ~ 120.000 - 150.000 objects cached in ~ 4GB
memory and the backends have a much easier life than before Varnish.
We are about to upgrade RAM on the Varnish boxes, and eventually we
can switch to disk cache if needed. Since we run a news/media site we
know that a few pages gets most of the traffic so refilling the cache
on restarts is not a problem.

In my opinion refilling the cache should be a problem whatever type of
site you are running, but hey, I could be wrong. Varnish should
nevertheless not be an excuse for writing slow/poor applications
making rebuilding slow or application server crash.

Am I missing something here?

- Bendik



More information about the varnish-misc mailing list