In this blog series, we’ve been looking inside Varnish to see what’s under the hood. There’s a lot more going on than meets the eye, beyond simple caching, beyond even Varnish Configuration Language.
Varnish is an HTTP reverse proxy, but it’s so much more than that, and not just because of its impressive performance. A single Varnish Enterprise node can process more than 100,000 simultaneous requests with sub-millisecond latency and a throughput nearing 500 Gigabits per second.
We’re going to zoom out a little now, and take a look at how features within Varnish benefit a wider content delivery network (CDN) context. What happens when you take the potential of a single Varnish node and scale it up to a full CDN?
Multi-layer Varnish caching for an optimized experience
Varnish Private CDNs are organized around separate tiers. Thanks to the usual Varnish flexibility and power of VCL, each tier can be optimized for its specific purpose to provide the best possible performance, efficiency and user experience.
The edge tier, made up of Varnish nodes closest to users, delivers content seamlessly and at low latency, while the storage tier can be optimized for keeping large-volume datasets. The origin-shield tier significantly reduces backend traffic, minimizing the number of requests hitting the backend. It’s not unusual, after deploying a Varnish CDN, to see backend server requirements reduced by half. Varnish takes on the majority of traffic, resulting in significant cost savings.
Reach everyone with tailored CDN coverage
Having the option to place Varnish servers where public CDNs have no coverage also means you’re able to reach your key audiences, wherever they are. This can be combined seamlessly with existing public CDN usage. Leave the public CDN to handle some traffic, for example, while Varnish tackles the priority audiences in a single country.
Varnish features that excel in CDN contexts include:
- High availability - Replicate content across each Varnish node to ensure its cached everywhere, for everyone, and minimize cache misses
- Request collapsing - combine requests for the same object into a single request, to avoid overloading the origin
- Broadcaster - send cache invalidation requests to multiple Varnish nodes simultaneously, to keep everything up to date easily
Managing Varnish private CDNs, with potentially dozens of individual nodes, is made straightforward using Varnish Controller, a dashboard for organizing and scaling Varnish clusters. Metrics display cache ratios, traffic types, content types and more.
It’s not just what’s going on under the hood that’s important with Varnish, it’s how individual nodes fit together, talk to each other and cache effectively. With multiple tiers of caches, each tailored to specific needs, end-users get an enhanced, responsive experience while critical backend infrastructure is protected and operating costs are reduced.