plone.recipe.varnish 6.0.0b1 generates vcl which is only suitable for Varnish 6.0.6. IIRC the purge command got extracted in its own module in Varnish 6.
We had support for 3 different varnish versions in the recipe, but it got too complicated and became unmaintainable. Last year I found out purging was completely broken if you used Varnish 6.0.3 because snippets for an alternative purge strategy got activated based on a faulty programmed switch that confused the minor and patch version fed into the recipe on varnish-version.
Also Varnish the organisation changed ther release strategey because they waited for user feedback before every release, nothing came back, and as soon as the release was made people started complaining their Proxy server crashed. so they now release whatever is there every 6 months in a new major release and nominate a 'stable' version from existing versions every x years.
6.0.X is the current LTS. And stuff does break, Varnish 6.1, 6.2 and 6.3 each have small tweaks which kill the VCL we generate for 6.0LTS.
I 'announced' plone.recipe.varnish. 6.0.0b1 last month at the PloneTagung and asked who was using the recipe and for feedback . Turns out almost everybody 'knows' about the recipe and looked at the generated VCL at some moment for inspiration but then tweaks the vcl and switchsed to a custom setup. The curse of a 'generic' black box recipe, ah Well
This is my current buildout setup. I have switched in this project from haproxy to using the internal Varnish load balancer (Director). Down side is that you loose sticky sessions for logged in users, this is round robin, but the big advantage is that grace healthy and grace-sick are working properly.
Plone 4+ should work without sticky sessions but there have been edge cases independent of performance reasons: one I saw 5-6 years ago sporadically was an error on a newly created page: when you save your version on zeoclient1, zeoclients 2, 3, etc. need to get this information through the zeoserver connection. If the browser request for the view of the new object gets to zeoclient2 before the ZODB can sync it to the clients, the page does't exist yet
I found an example for sticky sessions from a Varnish blog post but it is not trivial. See the TODO I created for more info in the repo: plone.recipe.varnish/TODO.rst at master · collective/plone.recipe.varnish · GitHub
[varnish-build]
recipe = plone.recipe.varnish:build
url = ${versions:varnish-url}
[varnish-configuration]
recipe = plone.recipe.varnish:configuration
backends =
www.website.com:127.0.0.1:${conf:zeoclient}
www.website.com:127.0.0.1:${conf:zeoclient2}
balancer = round_robin
grace-healthy = 60s
grace-sick = 600s
varnish_version = 6
vcl-version = 4.1
[varnishd]
recipe = plone.recipe.varnish:script
bind = 0.0.0.0:${conf:varnish}
cache-type = malloc
cache-size = ${conf:varnish-cache-size}
secret-file = ${varnish-secret:location}
mode = foreground
name = ${conf:ramlocation}/${conf:projectname}-varnish
[varnish-secret]
recipe = plone.recipe.command
location = ${buildout:directory}/var/varnish_secret
command =
dd if=/dev/random of=${:location} count=1
chmod 600 ${:location}
[varnish-clearcache]
recipe = collective.recipe.template
input = inline:
#!/bin/bash
${varnish-build:location}/bin/varnishadm -n ${varnishd:name} "ban req.url ~ ."
echo "sent ban req.url ~ . command to varnish"
output = ${buildout:directory}/bin/varnish-clearcache
mode = 755