Understanding cache utilisation

Dridi Boukelmoune dridi at varni.sh
Tue Nov 7 06:55:59 UTC 2017

> Of the objects that are being nuked/evicted, were they close to their
> natural expiration time anyway? Were they ever used to serve a cache
> hit?
> Of the objects that have been nuked, are they requested shortly after,
> suggesting it may have been worth having a larger cache in order to
> retain them a bit longer?
> I did not see an easy way to answer these questions with the standard
> Varnish toolset - am I missing something?

I think you are correct. The grace period could also be responsible for
keeping expired objects around and making them good candidates for
LRU eviction.

> I looked through the code paths in Varnish 5.1 responsible for
> expiration and nuking and it seems the object hit count and ttl is
> available in that context - would it be worth writing a patch to log
> these fields to the VSL?

You could add a `t=%f` to the `ExpKill LRU` log records, and introduce
something like a `h=%d` for hits and add it to the LRU and EXP_*
variants of the ExpKill record.

See `man vsl` for Expkill. I'm not sure such a patch would be
accepted as we usually are cautious with the VSL throughput but at
least I would gladly review it (merging's not my call in this area).


More information about the varnish-misc mailing list