November 15, 2024
3 min read time

Varnish Enterprise 6.0.13r8: Powerful New Features, Major Performance Gains, Slashed Cloud Resource Use and Costs

Our latest release, Varnish Enterprise 6.0.13r8, introduces new features and optimizations that make a real difference for high-performance caching and content delivery, while also driving down cloud costs. The update includes key changes in vmod S3, parallel ESI, and a major efficiency improvement in MSE4 for handling large-scale cache invalidations. This upgrade is especially impactful for users with persistent caching and high object counts, who will likely notice a significant boost in Varnish’s efficiency, potentially allowing for more cost-effective cloud resource use.

Major Optimization: MSE4 ykey Handling

The ykey optimization in this release is a substantial leap forward. For environments with persistent cache setups and heavy ykey invalidations across vast numbers of objects this reimplementation is a game-changer. Varnish is now faster and more resource-efficient, reducing memory usage by 25% and keeping CPU demands steady, even for larger datasets (over 30 million objects). The reworked ykey structure enhances scalability, making key lookups more predictable and memory-efficient by design, thanks to a lean, self-balancing tree structure.

In some cases, this optimization allows users to switch to more cost-effective cloud instances, freeing up budget without sacrificing performance. New counters in MSE4 also track memory consumption and time spent on invalidations, offering better monitoring, transparency and control.

Highlights of the New Features

Custom Claim Reader in JWT vmod

Varnish has made its JWT vmod even smarter with support for reading custom claims directly. If your setup involves stateless authentication, this update can save you lines of VCL code by letting you parse and act on custom claims in the JWT tokens, like setting user roles for access control.

vcl 4.1; import jwt sub vcl_init { new jwt_reader = jwt.reader(); } sub vcl_recv { # Parse the token provided in the Authorization header if (!jwt_reader.parse(req.http.Authorization)) { return (synth(401, "Invalid Authorization Token")); } # Set the secret used to verify the signature if (!jwt_reader.set_key("changeme")) { return (synth(401, "Invalid Authorization Token")); } # Verify the token using the HS256 algorithm if (!jwt_reader.verify("HS256")) { return (synth(401, "Invalid Authorization Token")); } # Get the claim named "role" and put its value into the request header # named Role. If the claim does not exist, use the value "none". set req.http.Role = jwt_reader.get_claim("role", "none"); }

Smarter Concurrency for Parallel ESI

Parallel ESI allows multiple fragments to be fetched at once, speeding up content delivery. But too many parallel fetches can overwhelm your origin server. Now you can set a limit on concurrent fetches with esi_limit, defaulting to 10, to keep things efficient and prevent overloading your backend.

Error Control in Parallel ESI

This release also introduces error handling for parallel ESI with the onerror attribute in <esi:include/> tags. You can specify whether failed fragments should halt the request or allow it to continue. This is handy for those wanting flexibility in their content delivery, even when some fragments fail.

AWSv4 Signatures on All Backend Requests

Varnish Enterprise’s S3 vmod now allows AWSv4 signatures on any backend request, making it easier to securely access AWS services without limiting you to S3 backends. This will be particularly useful for users who rely on various AWS services and want a secure, signed connection.

Quality of Service (QoS) for IPv6

IPv6 support is now integrated into Varnish’s Quality of Service (QoS) control, letting you prioritize traffic on both IPv4 and IPv6 networks. This is particularly beneficial for devices like set-top boxes that require high-priority traffic.

Upgrade Notes

  1. Recreate MSE4 Books and Stores: The upgraded ykey handling requires recreating books and stores. If you try to start Varnish with the old format, the process will be halted due to a file device version mismatch.

  2. Recompile Custom VMODs: With the application binary interface (ABI) version change, custom VMODs need recompilation to work with this release. Otherwise, Varnish will return an ABI mismatch error.

For full details, check out the official documentation and Changelog.