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

Christoph cm at appliedprivacy.net
Thu Oct 28 17:20:59 UTC 2021


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]) )



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


More information about the Pdns-users mailing list