Is asychronous DNS lookup worth keeping at all?

Hal Murray hmurray at megapathdsl.net
Thu Dec 3 12:18:28 UTC 2015


I don't know the details of the startup sequence well enough to have that 
sort of discussion.

ntpd doesn't get started after the first response.  It waits for a few 
packets so the peer filter has something to work with.  It will run with only 
one server but it runs better when it has several.  I don't know how the 
startup area decides to go with the only server it will ever get or wait for 
slow DNS to find more.

We could setup a few test cases, and measure the results, then hack the code 
to not use threads and run them again.  That is worth doing even without this 
discussion.

-------

esr at thyrsus.com said:
> 2. getaddrinfo() is called twice during argument or config parsing.
>    It launches two worker threads. 

I think it only uses 1 thread.  That's good for saving resources, but bad if 
you have lots of resources and want to get started quickly, especially if the 
DNS for the first one is slow or times out.


> 4. Sometime later, the callback passed to getaddrinfo_sometime is called and
> the
>    numeric IP for one hostname becomes available. A UDP socket is opened
>    and the protocol engine ships a query to the server (or pool whatsis)
>    at the other end of the association. 

It doesn't have a socket per server.  It has one per interface.  They get 
setup early.  (I don't know how it decides which one to use when it has more 
than one.)


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list