Understanding cache utilisation

Jason Stangroome jason at codeassassin.com
Tue Nov 7 05:22:22 UTC 2017


For at least one site that I am using Varnish Cache for, the allocated
cache size is fully utilised and objects are now being nuked/evicted
from the cache. Before I blindly supply more resources to provide a
larger cache, I'd like to understand if the cache space is being used

For example, of the objects that are expiring naturally, were they
ever used to serve a cache hit? If not, it was probably wasteful to
store them in the cache in the first place.

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

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 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?

How do others ensure their allocated cache size is well utilised
before growing the cache?



More information about the varnish-misc mailing list