On Mon, Sep 14, 2009 at 05:49:38PM +0100, Laurence Rowe wrote: > 2009/9/3 Poul-Henning Kamp <[email protected]>: > > > 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
pgpxKuIb1JxH9.pgp
Description: PGP signature
_______________________________________________ varnish-misc mailing list [email protected] http://projects.linpro.no/mailman/listinfo/varnish-misc
