bind caching algorithm?

Barry Margolin barmar at alum.mit.edu
Thu Apr 8 01:01:05 UTC 2004


In article <c4sk89$12bh$1 at sf1.isc.org>,
 KyoungSoo Park <kyoungso at cs.princeton.edu> wrote:

> Hi,
> 
> Is there anyone who's familar with bind's caching algorithm?
> I know it's based on TTLs of the result records, but there should be an 
> evicting algorthm as well.
> How does bind do cache eviction? LRU, LFU ... ?

When it looks up an existing cached record, it checks whether its TTL 
has expired, and evicts it if so.  Also, there's a periodic "cleaning" 
that scans the entire cache, evicting all records that have expired; the 
frequency of this is controlled by the "clean-interval" named.conf 
option.

> How does it search for a cached record? Is it using hashing(what kind of)?

The organization of the cache changed between BIND 8 and 9, and could 
change again.

> I don't think bind is doing very stupid thing like linear search on some 
> lists or even incur thrashing,
> but when I do stress test with a lot of requests, usually the memory 
> size gets bigger and bigger
> and at some points, the reponse gets very slow. I know I can place a 
> limit on the caching memory size,
> but it seems not quite well controlled with that option.

BIND's cache organization is not very localized.  So if the cache 
doesn't fit in RAM, it often thrashes and performance goes into the 
toilet.  This was definitely true in BIND 4 and 8; I don't know whether 
or not it was improved in BIND 9.

-- 
Barry Margolin, barmar at alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


More information about the bind-users mailing list