Martineau
Part of the Furniture
Totally agree.The cache hit percentage in the UI is calculated hourly (at :59) and is calculated the same way as the script does it when you show stats.
Unbound tracks the number of hits and misses and total requests. It is in memory only so if you restart unbound those stats reset. This has nothing to do with the cache, these are just numbers unbound has built internally to track usage.
The calculation is simple total hits / total requests. It has always been the same with no changes.
When I boot my router, yes my number drops as there is such a low number of requests processed by then. But by the next hour it has come back up into the 80s and then grows to 90%.
That also being said, this is highly dependant on your devices and browsing habits.
I do believe there was a change not too long ago to change the max and min time to live inside the conf file. This should change your testing as in my understanding, but may be worth a review.
“Change 'cache-max-ttl: 21600' and 'cache-min-ttl: 5 to 14400/1200'”
Also, it should be noted that we are now using unbound v1.10.0 rather than v1.96.x.
Furthermore, when auto-saving/restoring the cache across a reboot, I'm pretty sure there appears to be a lot less cached buffer entries restored, and as you state, may be as a result of the 'cache-max-ttl:' and 'cache-min-ttl:' values, but as I have stated previously,....
"no one was ever apparently concerned with the loss of the dnsmasq cache during a reboot, nor its cache efficiency"
i.e. terminate unbound, then interrogate dnsmasq's cache stats, i.e. admittedly the dnsmasq metrics are only representative after a limited couple of mins dnsmasq has been UP, but how should the counts 712/331/117 be used/interpreted together to calculate a hit percentage? - assuming it really matters in the real-world!
Code:
May 1 13:22:26 RT-AC68U dnsmasq[5218]: cache size 1500, 0/712 cache insertions re-used unexpired cache entries.
May 1 13:22:26 RT-AC68U dnsmasq[5218]: queries forwarded 331, queries answered locally 117
May 1 13:22:26 RT-AC68U dnsmasq[5218]: pool memory in use 0, max 0, allocated 0
May 1 13:22:26 RT-AC68U dnsmasq[5218]: server 127.0.1.1#53: queries sent 331, retried or failed 9
May 1 13:22:26 RT-AC68U dnsmasq[5218]: server 100.120.224.1#53: queries sent 0, retried or failed 0
May 1 13:22:26 RT-AC68U dnsmasq[5218]: server 1.1.1.1#53: queries sent 0, retried or failed 0
Last edited: