On glibc's resolver

Dimitrios Apostolou jimis@gmx.net
Wed Dec 26 09:42:00 GMT 2012


Hi Siddhesh,

On Wed, 26 Dec 2012, Siddhesh Poyarekar wrote:
>
> * Linux-specific: Use the kernel notify interface (or something
>  similar) to asynchronously reinitialize the resolver when a change
>  is detected.
>
> * Memory map resolv.conf and iterate through the nameservers
>  everytime, like we do for hosts.  Really bad for performance and
>  hence I'd think this would get a 'no'.

Why not share a small memory segment among all processes with the 
resolv.conf contents in binary form. Whenever a process parses 
resolv.conf, it should also update the SHM file. So it would be updated by 
firefox or networkmanager, or whoever calls res_init(), but all processes 
will profit. Optionally re-parsing could happen without even res_init(), 
but on the first timeout. Since this would be system wide, the overhead 
will be for a single process only.

I'm thinking that ideally all caching of resolved and unresolvable names 
should happen in a common place for all processes, and this could happen 
with shared memory better than with separate daemon. But I'm probably 
taking this too far.


Thanks,
Dimitris


>
>



More information about the Libc-alpha mailing list