Dual server Varnish setup
Martin Boer
martin.boer at bizztravel.nl
Thu Feb 10 15:14:29 CET 2011
I would also add weights so that each varnish prefers to ask its sibling
say 250 times more often than asking the app-server.
This will ensure that both varnishes will be as filled and as equal as
possible.
I don't know if 250 could be replaced by a larger number but this works
for me.
Regards,
Martin
On 02/10/2011 02:46 PM, Laurence Rowe wrote:
> On 8 February 2011 23:05, Ben Dodd<B.Dodd at comicrelief.com> wrote:
>> Given this functionality, does anyone know what the VCL is required to implement this dual server Varnish setup scenario?
>> http://varnish-cache.org/trac/wiki/VCLExampleHashIgnoreBusy
> Something like this should work:
>
>
> backend appserver { ... }
> backend other_varnish { ... }
>
> # Server 1
> sub vcl_recv {
> set req.backend = other_varnish;
> if (req.http.X-Via-Varnish || !req.backend.healthy) {
> # Request is coming from the other server.
> # Ignore busy objects to avoid race condition.
> set req.hash_ignore_busy = 1;
> set req.backend = appserver;
> } else {
> set req.http.X-Via-Varnish = "true";
> }
> }
>
> # Server 2
> sub vcl_recv {
> set req.backend = other_varnish;
> if (req.http.X-Via-Varnish || !req.backend.healthy) {
> # Request is coming from the other server.
> set req.backend = appserver;
> } else {
> set req.http.X-Via-Varnish = "true";
> }
> }
>
> Laurence
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
>
More information about the varnish-misc
mailing list