dnscache memory usage
Ian Lance Taylor
ian@airs.com
Fri Mar 16 07:47:00 GMT 2001
"Frank Ch. Eigler" <fche@redhat.com> writes:
> Since its startup a few weeks back, dnscache has blossomed to a
> chubby 95MB memory image -- the single biggest process running on the
> machine. An eye will need to be kept on it, in case it keeps growing.
dnscache does not use dynamic allocation while it runs. It allocated
that 95MB when it started up, and it will never change.
The value is controlled by the file
/sourceware/djbdns/dnscache/env/CACHESIZE
I have set that file to 100000000, which is the 95MB you see.
I started at a lower value, and set it to this one based on
measurements of the cache turnover time. At this level the cache is
turning over about every 4 days. That is a bit more than necessary,
since many TTL values are 1 day or 3 days. A value of 10000000 led to
a cache turn over of 0.35 days, which is clearly too small--the server
will wind up looking up DNS entries again.
This is the reason I was thinking of eliminating reverse DNS lookups.
The reverse DNS lookups take up a substantial portion of the DNS cache
space, since they come from everywhere and reverse lookups are
generally more complicated than MX lookups--the names are longer, and
often have several delegations over the path. If we eliminate reverse
lookups from the web server, we can certainly reduce the DNS cache
size with no bad effects.
To reduce the cache size, change the file mentioned above, and run
/usr/local/bin/svc -t /service/dnscache
That will restart dnscache with the new cache size.
Ian
More information about the Overseers
mailing list