VCL refcounting vs temprerature

Dridi Boukelmoune dridi at
Tue Jan 3 07:30:57 CET 2017

Hi everyone,

A quick message to make you all aware of a small problem that is
nothing new but interesting to revisit since we have started
discussions to REFCOUNT ALL THE THINGS, starting with backends.

The way workers don't release their VCL (unless we enable the vclrel
debug flag in the CLI) means that a worker going back to the pool may
be doing so while holding a ref to a VCL that may later be discarded.
You need enough traffic to get to use those workers, otherwise there's
no way to complete the discard operation.

It has been true for quite a while, possibly from the beginning, and
AFAICT the first knob to control this behavior appeared in the commit
2023864 (from 2010).

Fast forward to Varnish 4.1, we introduce VCL temperature and instead
of blocking the discard operation it now blocks the cool-down operation.

A VCL may hang in a busy state after either:

- vcl_cooldown (if state is auto)
- vcl.state <name> cold
- vcl.discard <name>

This is nothing new, but it partially defeats the purpose of having a
COLD state with a reduced footprint (which was new). The expansion
of refcounting to more areas is a good occasion to have this case in


More information about the varnish-dev mailing list