On Wed, Oct 23, 2013 at 10:32 AM, Joran Dirk Greef <[email protected]> wrote:
> I saw that dns.lookup uses getaddrinfo(3) which shares the thread pool with
> fs operations (https://github.com/joyent/node/issues/2868) and that the docs
> mention the following:
>
> "All methods in the dns module use C-Ares except for dns.lookup which uses
> getaddrinfo(3) in a thread pool. C-Ares is much faster than getaddrinfo but
> the system resolver is more constant with how other programs operate. When a
> user does net.connect(80, 'google.com') or http.get({ host: 'google.com' })
> the dns.lookup method is used. Users who need to do a large number of
> lookups quickly should use the methods that go through C-Ares."
>
> What exactly does "but the system resolver is more constant with how other
> programs operate" mean?
>
> Is it really necessary that Node's net.connect etc. still use dns.lookup
> internally?

Yes, for several reasons.  For example, c-ares doesn't speak mDNS and
probably never will, its notion of what the upstream DNS servers are
and in what order they should be tried can be wildly at odds with the
system resolver, and so on.

> I'm starting to see problems in production with outbound SMTP using
> net.connect calling dns.lookup, and this contending with fs operations. I
> need to rewrite a few functions to do the lookups using dns.resolve but it
> would be simpler if Node did this directly.

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to