Varnish returning synthetic 500 error even though it has stale content it should serve. But only seems to happen during/after a burst of traffic

Marco Dickert - evolver group marco.dickert at evolver.de
Fri Dec 17 14:18:23 UTC 2021


On 2021-12-17 13:16:42, Batanun B wrote:
> > The default VSL space is 80MB, which is "only" worth a few (tens of) thousands requests, so yeah, it can be a short backlog.
> 
> Yeah, I think 80MB is a bit to small for us. Ideally we should be able to sit down on a Monday and troubleshoot problems that occured Friday evening, but that might require a way too big VSL space. But a few hundred MB should be fine.

I recommend permanent logging, if you want to be able to debug older incidents.
We do it like this:

```
/usr/bin/varnishlog -w /var/log/varnish/varnish-500.log -a -D \
        -P /var/run/varnishlog-500.pid \
        -q 'RespStatus >= 500 or BerespStatus >=500'
```

I attach our systemd unit file, for you may be interested.

-- 
Cheers
Marco Dickert
-------------- next part --------------
[Unit]
Description=Varnishlog for response codes > 500
After=varnish.service

[Service]
Type=forking
ExecStart=/usr/bin/varnishlog -w /var/log/varnish/varnish-500.log -a -D -P /var/run/varnishlog-500.pid -q 'RespStatus >= 500 and ReqHeader:Host !~ staging'
ExecReload=/usr/bin/kill -HUP $MAINPID
PIDFile=/var/run/varnishlog-500.pid
Restart=always

[Install]
WantedBy=multi-user.target


More information about the varnish-misc mailing list