max-cache-size (was: no subject)
Mark_Andrews at isc.org
Wed May 28 23:54:19 UTC 2008
> Selon John Wobus <jw354 at cornell.edu>:
> > If you can solve the problem with more memory, that could be your best
> > solution. I used max-cache-size for a while, but eventually discovered
> > the cache was not actually growing indefinitely. The problem was that
> > we
> > needed just a bit more memory for the cache size to stabilize. This
> > was not at all evident from the memory-usage statistics we gathered
> > before the memory upgrade. But a modest memory upgrade indeed
> > solved our problem. I believe that using the max-cache-size also
> > causes bind to spend more CPU on cache management.
> > However, I can imagine situations where merely adding
> > a bit of memory would not be enough. For example, if someone is doing
> > some serious spidering using your nameserver, then the eventual
> > stable cache size could be extremely large. However I believe there
> > are people on this list who have very large and diverse user-bases, yet
> > the cache sizes in their nameservers do stabilize at a reasonable
> > amount.
> I don't really understand how named allocate new amount of memory for cache a
> named don't seem to know how to release it and don't seem to have limit.
All records in the cache have a time to live. When this time to
live is exceeded they are removed and the memory freed for reuse.
This is done every cleaning interval (default 60 minutes) or
as a side effect of looking for or adding record at a name
with a expired record.
> > Your figure of '2M', though, is very small and suggests you are in
> > a situation where your resources are very limited.
> I put such a small value because I wanted to test this parameter. I originaly
> put '64M' and noticed bind would take the exact same amount of memory without
> any parameter.
> I did that :
> BIND 8.4.6 -> named process take 10mb of memory
> BIND 9.4.2 no max-cache-size -> named process take 60mb of memory and "rndc
> dumpdb -cache" generates a 56Mb file
> BIND 9.4.2 + max-cache-size 'anything you want M' -> same as above
> My DNS servers have only 128 Mb of ram, so I would like to limit bind to grow
> too widely in ram.
> > Bind also uses memory for other functions besides the cache
> > itself. If you limit the cache, e.g. to 2M, then I'm guessing
> > other uses of memory become dominant, and a change, say, between
> > 2M and 10M might not be very visible in terms of memory size.
> > Some other bind uses of memory might even grow with usage,
> > in a similar manner to the cache: perhaps someone on this list can
> > comment on that. If you really are attempting to run with severely
> > limited
> > resources, possibly other parameters could be adjusted to reduce
> > memory usage, e.g. number of simultaneous recursive clients
> > supported.
> Thank you for answering precisely John,
> > John Wobus
> > On May 23, 2008, at 5:32 AM, gagadget at free.fr wrote:
> > >
> > > Hello everybody,
> > >
> > > I am running BIND 9.4.2 and I want to limit the cache size of the
> > > named process
> > > because It tends to grow indefinitly.
> > >
> > > In order to do that, I put the following line in global option section
> > > :
> > >
> > > max-cache-size 2M ;
> > >
> > > The problem is : this parameter does not seem to work at all because
> > > with or
> > > without it, the size of named is the same. Doing a "rndc dumpdb
> > > -cache" show a
> > > named_dump.db file size of about 60Mb which is much more than 2Mb as
> > > set in
> > > named.conf.
> > >
> > > Am I missing something or the parameter is not used by named ?
> > >
> > > Regards,
> > > Gael.
> > >
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742 INTERNET: Mark_Andrews at isc.org
More information about the bind-users