[Dnsmasq-discuss] Feature request: add one DNS cache statistic

Simon Kelley simon at thekelleys.org.uk
Thu Mar 5 23:00:30 GMT 2020


On 03/03/2020 09:03, Wim Nelis wrote:
> Hello,
> 
> 
> If the cache statistics are requested, the maximum cache size is
> returned together with the number of insertions and the number of
> deletions before expiration of the cache entry (live freed aka
> evictions). The request is to add preferably the actual cache size or
> alternatively the number of deletions due to expiration of the cache entry.
> 
> Currently one can only see that the cache is too small if the number of
> live freed entries becomes too large. The opposite, the cache is too
> big, is not visible. This can be advantageous to know in a
> resource-limited environment.
> 
> The suggested alternative is based on the assumption that the actual
> size equals the total insertions minus the live freed entries minus the
> expired freed entries.
> 
> 

I think what you probably need here is the maximum cache occupancy, ie
if entries are thrown out of the cache as soon as the expire, what is
the maximum number of cache entries, ever. Unfortunately, that's kind of
difficult to determine, because expired entries only get removed
opportunistically, unless there's pressure for cache space. The maximum
cache occupancy would include a load of already-expired entries which
will never be used again, but which have not been deleted because
finding them takes resources, and there's no need because we've not run
short of cache space.


Simon.




More information about the Dnsmasq-discuss mailing list