Carsten Wawer
Carsten Wawer

Reputation: 43

Best High-Availability-Setup for Varnish

I am searching for the best Setup for a High-Avalability-Setup for Varnish.

The Standard-Setup with more than one Varnish-Instance, every Instance has it's own Caching-Storage and so every Instance does it's own request on the backend.

The Varnish-Cache is not shareable between several servers, even if the Filesystem-Option for Varnish_Storage is used.

There seems to be a High-Avalability-Option in Varnish plus (the commercial Product) - is it worth the price? Any RL-Experiences out there? ;-)

As something "in between" i found this (kind of) hacky Solution, that does not Replicate the data, but forwards every Request to the other Varnish-Instances: http://guytabrar.co.uk/index.php/2016/02/04/varnish-cache-replication-with-vcl/

Anything i have missed? More ideas worth investigating?

Thanks for your thoughts! Carsten

Upvotes: 3

Views: 2407

Answers (1)

Helmut Januschka
Helmut Januschka

Reputation: 1636

varnish-plus offers a cache replication, but i personally haven't tried it, but according to their docs, they are launching a custom deamon that replicates the Varnish-SHM.

forwarding every request, is not a good scenario as you are doubling up the traffic that reaches the backend - and in some situations even produces big troubles (e.g: POST requests that store things in databases)

we are using varnish, on a quiet large site, 4-10TB per day, and what we are using since many years, is a simple setup:

the only problem is when we restart all varnish nodes at-once - so we have a deployment script that restartes one after another, and pausing for 10-20 minutes in between, so that there is no scenario where every varnish is at 0% hit rate.

to monitor hit rate we use a script like this: https://gist.github.com/hjanuschka/221521ed0cdbd4ed47c6782640544c33

what we learned, after many years, in-fact 2 active nodes arent really needed. as varnish performs really well and never was the bottlneck of any issue. but infact having a standby is important. (in case of HW errors)

Upvotes: 1

Related Questions