Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jan 2008 13:59:51 -0800
From:      Doug Barton <dougb@FreeBSD.org>
To:        =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= <des@des.no>
Cc:        hackers@freebsd.org
Subject:   Re: 'periodic daily' memory usage
Message-ID:  <479E5057.6000309@FreeBSD.org>
In-Reply-To: <86k5lv1l84.fsf@ds4.des.no>
References:  <86k5lv1l84.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
Dag-Erling Smørgrav wrote:

> The solution I found that did work was to eliminate the loop over
> $MP and use 'find -s $MP ...' instead, which eliminates the need
> for sort. This reduces the memory requirement for 100.checksetuid
> by, oh, 80% or so, and greatly simplifies the logic.

Why don't you post that diff? Sounds like a good idea to me.

> Note that 'find -s' and find | sort may not produce the same
> output, but this only means you'll get an ugly diff the first time
> you run the new script - it won't cause any trouble later.
> 
> An entirely different issue is why named uses so much memory...

It's a feature. :) If you're using it to resolve stuff out in the
wild, it's caching the answers to questions it has been asked (plus
whatever additional, authoritative information that was sent by the
remote name server). If you artificially reduce the size of the cache,
it will result in more network traffic, assuming it gets asked the
same question again. If you have a situation where you have
applications that ask a lot of questions once, or just a few times in
quick succession (mail farms often fit this profile) then reducing the
cache size probably won't hurt too much. If you have an environment
where your users ask a lot of different questions, but keep asking
them, reducing the cache is just going to shift the load elsewhere.

One thing you can do is reduce the cleaning interval, since that will
flush out the data that is past its TTL that much faster. This works
particularly well for the first scenario described above.

> does anybody know of a way to specify how much memory named may use
> for its cache?

You'll want to use BIND 9.4.2 for that if you want to do it, and take
a look at the ARM manual to get the right combination of options. I'd
tell you if I knew, but I never limit the cache on my name servers. :)

BTW, I think you mentioned that named had grown to 24M or so, FYI that
is actually a very small process size. My very lightly loaded resolver
for my home network is at 23M, with hardly any cache at all.

If I thought there was a good alternative resolver I'd recommend one,
but IMO BIND is it right now. There are a couple others in development
right now, but they are not yet ready for prime time (again, IMO).

hth,

Doug

-- 

    This .signature sanitized for your protection




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?479E5057.6000309>