named: high memory usage under FreeBSD-7...?
Chuck Swiger
cswiger at mac.com
Tue Dec 21 23:52:36 UTC 2010
Hi, Dough--
On Dec 21, 2010, at 2:22 PM, Doug Barton wrote:
> On 12/16/2010 14:48, Chuck Swiger wrote:
>> Hi, bind-users--
>>
>> I'd recently updated a machine to FreeBSD 7-STABLE, and I've noticed
>> that named from the base system (which claims to be BIND 9.4-ESV-R4)
>> is using more than twice as much memory as it used to:
>
> Hey Chuck, sorry I didn't respond to this on the FreeBSD list. In FreeBSD 6.x we had BIND 9.3.x. BIND 9.4.x definitely uses more memory, this is a feature. :)
As I mentioned in another thread, the issue was that "it appears max-cache-size option wasn't being honored by base named (claims to be BIND 9.4.-ESV-R4) from:
FreeBSD example.com 7.4-PRERELEASE FreeBSD 7.4-PRERELEASE #1: Tue Dec 14 19:55:55 EST 2010
...whereas top showed that named from dns/bind-9.6 filled its cache under load until it reached the max-cache-size plus a chunk for the recursive clients, and then remained at a stable size afterwards."
>> PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND
>> 706 bind 4 4 0 69424K 57292K kqread 0:09 0.00% named
>>
>> It's serving about 20 zones with total record size of less than 100K,
>> and has the following option block set:
>>
>> options { directory "/var/named"; recursive-clients 400;
>> clients-per-query 210; max-clients-per-query 220; max-cache-size
>> 10m; };
>>
>> This box was previously running FreeBSD-6.4 and dns/bind94 port,
>
> Doubtful, as the code for BIND 9.4 in the base in FreeBSD 7.x is identical to that in the port. It's possible of course, but I can't see any reason off hand that the same BIND code running on FreeBSD 6 would use twice as much memory on 7.
I can't see any reason why the named from 7.x base would ignore max-cache-size-- unless it was picking up some other named.conf entirely, but then it wouldn't be loading the zones it was told to look at-- but the behavior was (and still is, AFAIK) reproducible.
>> and named never crept above 30M VSIZE/RES even under heavy load (ie,
>> "adnslogres -c 100" against a million line httpd-access.log file);
>> the size above is from named running for about a day, *without*
>> putting any significant load upon the nameserver....
>
> That must have been a very high percentage of the same hostnames showing up in those million lines if all of them fit into a 10 meg cache.
They *don't* all fit into a 10 meg cache. That's why it is useful for testing whether the named process is growing too big.
With dns/bind-9.6 port (ie ...ESV-R3), if I changed max-cache-size from 10 to 20 to 50 MB, then the process size grew to about 3 MB + 2 MB per 100 recursive clients being used + an amount that would grow to what max-cache-size is set at when put under load.
If max-cache-size = 10 MB and I run adnslogres with -c 100, then BIND 9.4-ESV-R4 would slowly grow to ~60MB RSIZE whereas BIND 9.6-ESV-R3 would grow to about 15 MB RSIZE and then stay there. If max-cache-size = 20 MB and I run adnslogres with -c 200, then BIND 9.4-ESV-R4 would grow to ~60MB RSIZE whereas BIND 9.6-ESV-R3 would grow to about 27 MB RSIZE. (etc)
Regards,
--
-Chuck
More information about the bind-users
mailing list