zlacker

[parent] [thread] 3 comments
1. bandie+(OP)[view] [source] 2025-03-26 12:40:02
maybe for most cases nscd was enough. not exactly a dns-cache but a hostname cache on one layer up.
replies(1): >>sleepy+sm
2. sleepy+sm[view] [source] 2025-03-26 14:56:38
>>bandie+(OP)
I used to work for a huge email sender (constant contact). Our mail servers needed to perform an absurd number of lookups while receiving and validating mail. When I was there, we used dnscache, running locally, on all our mail servers. But even with a local dnscache, the overhead of making DNS requests and handling their responses was high enough that adding nscd made a noticeable improvement in CPU usage.
replies(1): >>bandie+Jn
◧◩
3. bandie+Jn[view] [source] [discussion] 2025-03-26 15:04:42
>>sleepy+sm
i guess this shows that looking up getent hostname database cache is faster than looking up local dns cache because the former is simpler in data structure?
replies(1): >>sleepy+iH1
◧◩◪
4. sleepy+iH1[view] [source] [discussion] 2025-03-26 22:18:17
>>bandie+Jn
I didn't dig into it too deeply at the time, but I think part of it was that you don't need to open and write to a socket, so that's avoiding some system calls (socket(), bind(), sendto(), close()). IIRC we had nscd set up so clients directly read from shared memory that nscd kept updated, rather than getting requests over a socket.

There's also probably some savings around not having to convert between the structures used by gethostbyname and DNS questions&answers.

[go to top]