[Dnsmasq-discuss] Cache eviction policy

Simon Kelley simon at thekelleys.org.uk
Fri Jan 23 16:57:12 GMT 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Expired entries are evicted first. (since expired entries are dead
anyway, that means, in effect that nothing is evicted whilst there are
expired entries.) If there are no expired entries then the least
recently _used_ entries are victimised next.

New name and its hash has no effect.

Multiple addresses are all evicted at once, anything else would be
strictly incorrect. Google's 15 address record does  occupy 15
entries. CNAMEs are treated differently from A/AAAA records only to
the extent that if the A/AAAA target of a CNAME is evicted, then the
CNAME is evicted too.

If you send SIGUSR1 to the dnsmasq process, it will give you some
stats about how many non-expired cache entries have been evicted.

There's one more wrinkle, which is that cache entries have space for
names only 50 characters long (ie most of them). Longer names compete
for a pool of long name entries.


Cheers,

Simon.



On 23/01/15 15:42, Marc Branchaud wrote:
> Hi all,
> 
> Can anyone describe (or point me to) how dnsmasq decides to evict
> entries from a full cache?
> 
> We're trying to characterize dnsmasq's behaviour when its cache is
> full, and we're not quite sure how it works.
> 
> Is the eviction policy strictly FIFO or is there some heuristic?
> 
> Is there a preference to evict expired entries over unexpired
> ones?
> 
> Does the new name (and how it hashes) affect which old entries get
> evicted?
> 
> What about names with multiple addresses?  Will Google's 15-address
> name kick out 15 entries from the cache?  Conversely, when Google's
> 15-address name is evicted, does that make space for 15 new
> records?
> 
> Are CNAMEs treated differently than A/AAAA records?
> 
> Any insight would be much appreciated.
> 
> Thanks!
> 
> Marc
> 
> _______________________________________________ Dnsmasq-discuss
> mailing list Dnsmasq-discuss at lists.thekelleys.org.uk 
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlTCfWgACgkQKPyGmiibgrfTswCfSkq0Mph+nkAwSxJRIqIPtg1j
FP0An1WmJvITi/V7XyjccbUYZwpBpbXc
=HjB9
-----END PGP SIGNATURE-----



More information about the Dnsmasq-discuss mailing list