[Pdns-users] overall cache hit rate in a dnsdist -> recursor environment

Otto Moerbeek otto at drijf.net
Thu Oct 28 17:41:36 UTC 2021


On Thu, Oct 28, 2021 at 07:20:59PM +0200, Christoph via Pdns-users wrote:

> Hi,
> 
> 
> I'd like to calculate the overall percentage of
> queries that got completely answered with a cached entry,
> regardless of the type of cache (packet cache or not) and regardless
> of whether the cache was in dnsdist or Recursor.
> 
> simple setup:
> 
> clients -> dnsdist -> Recursor
> 
> Would you say this in an adequate usage and correct understanding of the
> related metrics to calculate the overall cache hit rate?
> 
> (dnsdist_cache_hits +
> pdns_recursor_packetcache_hits +
> pdns_recursor_cache_hits ) /
> dnsdist_frontend_queries
> 
> 
> or directly for grafana:
> 
> (sum(irate(dnsdist_cache_hits[$__rate_interval])) +
> sum(irate(pdns_recursor_packetcache_hits[$__rate_interval])) +
> sum(irate(pdns_recursor_cache_hits[$__rate_interval])))
> / sum(irate(dnsdist_frontend_queries[$__rate_interval]) )

Sadly it is not that simple, a recursor packetcache miss can lead to
multiple recursor queries to be answered (if the name/qtype iself is a
miss: retrieve NS records, DS records, plus qname minimization).
Each of of these queried can cause recursor cache hits or misses.

	-Otto
> 
> 
> 
> While writing this email I realized that dnsdist_frontend_queries is not
> documented, at https://dnsdist.org/statistics.html
> I can create a PR for it if my understanding of the metric is correct.
> 
> 
> thanks!
> Christoph
> _______________________________________________
> Pdns-users mailing list
> Pdns-users at mailman.powerdns.com
> https://mailman.powerdns.com/mailman/listinfo/pdns-users


More information about the Pdns-users mailing list