Re: dnscache memory requirements for large number of server files
Daryl Tester <[email protected]> Wed, 08 Sep 2010 00:47:07 +0930
| Newsgroups | gmane.network.djbdns |
|---|---|
| Message-ID | <[email protected]> |
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. -- Regards, Daryl Tester "It's bad enough to have two heads, but it's worse when one's unoccupied." -- Scatterbrain, "I'm with Stupid."