3. Hugo Cruz
Product Manager
About me
• Oslo based developer, from Portugal
• Lots of hats, mostly Front-end
Email: hugo@varnish-software.com
IRC: hugo on irc.linpro.no
Twitter: @hrcru
4. AGENDA
- Automating tasks with VARNISH PLUS
• The Varnish Plus minimum stack
• Playing with statistics
• VCL version control with Git
• Cache invalidation
• Increase value with VCS
9. BenefitsSetup
Management tools
Realtime monitoring
JSON API for everything
$ Setup Varnish Plus repository
$ Install Varnish Cache Plus
$ Install varnish-agent and vcs-probe
$ Install Varnish Administration Console
$ Install Varnish Custom Statistics
10. Varnish Cache Plus
Supercharged
version of the
popular open source
HTTP reverse proxy,
Varnish Cache
Varnish
Administration
Console
Cluster controller
for you Varnish(s)
installation
Varnish Custom
Statistics
A real-time
statistics engine
Varnish agents
and VCS probe
Varnish agent and
VCS probe are
responsible for
extracting data for
VAC and VCS
Minimal Value stack
17. Benefits
high performance purging
$ curl -X PURGE -H ‘X-Cache-Group: Production’
-H ‘X-HMAC:
0xf7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8
‘ -H ‘X-Timestamp: 1391641007 http://vac-server:8088/purge-url
purge several instances
in a group, fast
$ “ No need for extra setup. Purger is up and running with VAC, on port 8088.”
Issue a purge
acl purgers {
“127.0.0.1”;
“192.168.0.0”/24;
}
sub vcl_recv {
if (req.request == “PURGE”) {
if (!client.ip ~ purgers) {
error 405 “Method not allowed”;
}
if (digest.hmac_sha256(“secret-key”,req.url +
req.http.x-timestamp + req.http.x-cache-group) != req.http.x-hmac) {
error 405 “Method not allowed”;
}
return (lookup);
}
}
Extra security
Super Fast Purger
Fully secure
19. Benefits
Live Production
debugging
Business indicators
Realtime statistics engine
sub vcl_deliver {
# This creates a grouping for each specific value of the Host request
std.log("vcs-key: " + req.http.host);
# This creates a key based on both the Host header and the URL
std.log("vcs-key: URL-“ + req.http.host + req.url);
# This will create two keys 'MISS' and 'HIT', each counting
# stats for requests matching one of the two conditions.
if (obj.hits == 0) {
std.log("vcs-key: MISS");
}
else {
std.log("vcs-key: HIT");
}
}
Time series API
VCS
Basic setup
(counting hits and misses)
A/B testing
20. Minimum stack
Setup the components
Playing with
stats
VAC powered
Varnish stats
VCL version control
Integrating VCL and GIT
Cache Invalidation
Using the Super Fast Purger
VCS in production
Debugging with VCS
Summing up
21. Thank you!
Reach out to me if you have further questions
hugo@varnish-software.com