You probably use Varnish already as a way to absorb traffic spikes and let your backends breathe. If you have more traffic, you add more Varnish boxes, the way you are supposed to do. BUT… there are trade-offs to this:
- if your Varnish instances are accessed in a round-robin manner, adding a Varnish box will put extra strain on the backends as it’ll need to fetch (statistically) the same content as its neighbors. That's not very efficient.
- if you have a level-7 load balancer that consistently uses the same cache for the same content, you don't have the extra strain, but if one server falls, there's no backup for its cache. That's not very robust.
We’ve got a way to even the trade-offs out and still deliver the highest performance, reduce the backend load and ensure availability. It doesn't consume a lot of memory (< 100MB), it's fast and can do wonders for your cache hit-ratio and backend load: welcome to our latest version of Varnish High Availability (or VHA, if you're in a hurry), our cache replicator that's part of Varnish Plus. Since the last release, it learned a new bag of tricks that makes it more powerful and way easier to use, and I'm here to tell you how awesome it is.
What is VHA anyway, and why would I need it?
I’ve already told you a bit in the intro about what VHA can do and why you would need it. How does it work and solve the problems of availability and performance?
VHA is a tiny agent that you can install on all the cache servers you wish to replicate. It will watch the logs (just like Varnishlog or Varnishncsa) and look for cache insertions, and when it detects one, it issues an http request to its neighbors so they can cache the object too. That takes care of the robustness issue.
The little trick we use is that the neighbors will select the original Varnish as a backend, this way, we don't bother the "real" backends. And this addresses the efficiency issue.
What's new?
Since the last release, VHA gained:
- TLS support: Varnish Cache Plus supports the proxy protocol to interface with hitch, which protects your connections using TLS. The previous VHA only used plain http! Now, all your transfers can be encrypted, notably those between data centers.
- Cluster support: Before 1.1, VHA could only replicate its cache on one neighbor, which was a bit frustrating. This has changed, and replication can be done to a potentially infinite number of nodes very easily.
- Simpler VCL: All VHA in a replicated cluster can now share the same configuration. It simplifies management dramatically, opens opportunities to use VHA alongside the Varnish Administration Console, and reduces headaches greatly.
- VCL generated for you: In further headache-reduction news: the VCL is now simpler and more consistent across nodes, but it can also be generated from the cluster definition. This is one more step toward further automation and fewer human mistakes.
- Bandwidth load reduction: By default, VHA will now issue HEAD requests instead of GET ones, which effectively halves the network replication load, and that's pretty cool, especially if you are replicating across data centers.
Where do I get the new VHA?
If you are already a Varnish Plus customer, the packages should already be available in your repositories. If you are not a customer but would like to try VHA, please drop a mail to our sales team so we can arrange a trial or demo with you.
Image is (c) 2014 Stephen Donaghy used under CC license.