Re: dnscache memory requirements for large number of server files

"Lloyd Standish" <[email protected]> Tue, 07 Sep 2010 10:44:59 -0600
Newsgroups gmane.network.djbdns
Message-ID <op.vin8s90wx1lyi3@localhost>
Hi Daryl and Jeff,
Thanks for the information.  I agree that a linear search would not be a good idea.  Adding some sort of hashed lookup sounds like the way to go here.  I'm not very experienced at C (my experience is primarily in perl and bash) and I have little time.  If anyone here is interested in making this modification for pay, please contact me off-list.
--
Lloyd

On Tue, 07 Sep 2010 09:17:07 -0600, Daryl Tester <[email protected]> wrote:

> Lloyd Standish wrote:
>
>> Please help me estimate memory requirements to run dnscache
>> with about 769,000 files in the "servers" directory
>> (/etc/service/dncache/root/servers).
>
> Wow.  Even if you could get away with loading this much data, I don't
> think you'd want to as the code doesn't appear to be optimised for
> such an extreme case.  From a quick look at the relevant code (roots.c)
> it would appear to be roughly the length of the domain name (in wire
> format) + 64 bytes per domain name.  And the resultant "array" (it's
> actually a string) is linearly searched, which could be a killer.
>
> If your C is up to it, I'd look at modifying dnscache to perform a CDB
> lookup on the domain+querytype, and if you get a hit return your
> fictitious answer, otherwise proceed with the query normally.
>