-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
Add global flag for enabling asynchronous DNS resolution #49394
Copy link
Copy link
Closed as not planned
Labels
dnsIssues and PRs related to the dns subsystem.Issues and PRs related to the dns subsystem.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.stale
Description
What is the problem this feature will solve?
Most Node libraries end up using dns.lookup which in turn uses blocking getaddrinfo from libc, this is discussed in detail here
This problem is particularly pronounced when making lots of outbound HTTP requests, it seems Node maxes out at around 20 requests per second being busy performing DNS lookups most of the time.
Patching applications to use asynchronous resolver requires in some cases extensive work so it would be good idea to add option to substitute dns.lookup with asynchronous one globally.
What is the feature you are proposing to solve the problem?
For example in Go this is achieved with environment variables:
export GODEBUG=netdns=go # force pure Go resolver
export GODEBUG=netdns=cgo # force native resolver (cgo, win32)
What alternatives have you considered?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
dnsIssues and PRs related to the dns subsystem.Issues and PRs related to the dns subsystem.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.stale