varnish redundancy
Kristian Lyngstol
kristian at redpill-linpro.com
Mon Sep 14 18:54:40 CEST 2009
On Mon, Sep 14, 2009 at 05:49:38PM +0100, Laurence Rowe wrote:
> 2009/9/3 Poul-Henning Kamp <phk at phk.freebsd.dk>:
>
> > For it to be really smart you want to use directors for the
> > "other_varnish" and probes to ascertain health.
> >
> > We do not have a "priority_director" (we probably should have)
> > but you can get much the same effect with the random director
> > and very uneven weights:
> >
> > director other_backend {
> > { .backend = b_other_varnish ; weight=100000; }
> > { .backend = b_real_backend ; weight=1; }
> > }
> >
> > Should the probes mark the other_varnish unhealthy, all trafic
> > will go to the real backend.
>
> Is there an advantage in using a director here instead of the following?
>
> sub vcl_recv {
> set req.backend = haproxy01;
> if (!req.backend.healthy) {
> set req.backend = haproxy02;
> }
Both approaches have their benefits.
One benefit of using a random director is that it can have multiple
fallbacks, but then again, you can achieve that by having two directors: a
pool of primary directors (or a single backend), and do
if (!req.backend.healthy) {
set req.backend = fallbackdirector;
}
Using a single director with the weight-approach does have a benefit of
being nicer to read and maintain, but will give the fallback backends some
marginal amount of traffic even when the primary backends are healthy.
--
Kristian Lyngstøl
Redpill Linpro AS
Tlf: +47 21544179
Mob: +47 99014497
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20090914/c1c751e1/attachment-0003.pgp>
More information about the varnish-misc
mailing list