Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS cache for proxying to remote server? #653

Open
Rush opened this issue Jun 7, 2014 · 2 comments · May be fixed by #1574
Open

DNS cache for proxying to remote server? #653

Rush opened this issue Jun 7, 2014 · 2 comments · May be fixed by #1574

Comments

@Rush
Copy link
Contributor

Rush commented Jun 7, 2014

While I am primarily doing proxying to localhost servers I have experimented today with proxying to a remote server and it seems DNS query is being done on every request substantially increasing the request time. Should I query the IP from DNS manually or is there a cleaner way?

@Rush
Copy link
Contributor Author

Rush commented Jun 7, 2014

On a side-note, what performance penalty should I be looking at while proxying to remote host?
Having put my dns name to /etc/hosts I expected to see not more than 10% penalty but I what I see is:

  • Native request to remote server ~40ms
  • Request proxied through node-http-proxy with host in /etc/hosts: ~80ms
    I am measuring the time both in chrome in code from doing request to getting proxyRes.

@aaronmaturen
Copy link
Contributor

I found that by using https://www.npmjs.com/package/dnscache I'm able to get my performance tests to external domains down to about 6ms from 40ms... with just the default settings in the readme

const require('dnscache')
dnscache({
   "enable" : true,
  "ttl" : 300,
  "cachesize" : 1000
})

@oBusk oBusk linked a pull request Feb 24, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants