Recommended setup with large cache memory

JINMEI Tatuya / 神明達哉 jinmei at isl.rdc.toshiba.co.jp
Sun Sep 11 05:19:55 UTC 2005


>>>>> On Thu, 08 Sep 2005 16:44:12 +0200, 
>>>>> Attila Nagy <bra at fsn.hu> said:

> I would like to ask, what is the recommended setup, where large cache 
> memory is configured to the named process. In this case large means 
> about 1-1.5 GB.

> The problem is that if I set a max-cache-size to a high value, the 
> purging of old records (default cleaning-interval every 60 minutes) 
> takes minutes even on a fast machine. (2.6 GHz Opteron).

> During this time the server responds very slowly, if at all.

> If I set cleaning-interval to 0 (or increase to days for example), the 
> used memory grows above the configured limit. I guess if it reaches the 
> physical limit, it will begin swapping, but I don't want to see it.

(As already mentioned in this thread) Using
ISC_MEM_USE_INTERNAL_MALLOC should definitely help.  It doesn't harm
particularly for a uniprocessor machine, so I suggest that you try it
if not yet.

You may also want to decrease a hard-coded parameter that controls the
number of cache entries examined for cleaning at once.  The parameter
is defined at line 48 of bind-9.3.1/lib/dns/cache.c

#define DNS_CACHE_CLEANERINCREMENT	1000	/* Number of nodes. */

I hear that dropped queries with the default setting during the
periodic cleaning went away by decreasing this to 200 for an ISP
caching server.  Note that changing this value does not decrease the
cleaning load, so the server will still eat CPU during the cleaning
period.  Also, decreasing this parameter will probably make the
cleaning period longer.

Setting cleaning-interval to 0 and letting max-cache-size do all the
work for managing the cache size may also help in some environments as
you indicated.  But I suspect it cannot be a general solution because
the internal code logic is (almost) the same for periodical cleaning
and cleaning on over-memory.  For example, DNS_CACHE_CLEANERINCREMENT
equally applies to both, so if the period cleaning prevents your
server from answering some queries the same thing should happen in
cleaning due to over-memory.

					JINMEI, Tatuya
					Communication Platform Lab.
					Corporate R&D Center, Toshiba Corp.
					jinmei at isl.rdc.toshiba.co.jp



More information about the bind-users mailing list