Sorry for reviving this old thread but I just spend alot of time tracking down a performance issue that was caused by the same problem as below. Dns lookups were slow since they were being made for both ipv4 and ipv6 and a particular domain's ipv6 address couldn't be found and therefor was not cached. Every requst to this domain caused a dns lookup that took ≈ 80 ms which caused huge request delays since the internal thread pool was hogged making slow dns requests.
We solved it by installing dnsmasq locally on all servers but is there really no other way around this apart from making requests to IP addresses and handling the DNS lookups manually? Best regards, Gabriel Falkenberg Den torsdagen den 15:e december 2011 kl. 18:58:23 UTC+1 skrev Jonathan Leibiusky: > > that's a great idea. > it makes my app a little more complex, but it will fix my problem. > thanks! > > On Thu, Dec 15, 2011 at 12:40 PM, Ben Noordhuis > <[email protected]<javascript:> > > wrote: > >> On Thu, Dec 15, 2011 at 16:25, Jonathan Leibiusky >> <[email protected]<javascript:>> >> wrote: >> > My app is making lots of http calls (and I mean lots of them). And I am >> > using dnsmasq to cache dns resolution since it make sense, because I >> almost >> > always call the same host. >> > >> > It seems like nodejs is making ipv6 queries as well, and my dns don't >> know >> > anything about AAAA queries for that host, so dnsmasq will cache AA >> queries >> > and AAAA failed queries (for less time, as it was a fail). >> > >> > The problem there is that since it is caching them for less time, every >> once >> > in a while I will query again the DNS for AAAA queries, and what I see >> is >> > that it is slowing down the app. >> > >> > Now, I could increase caching time for failed queries. The problem >> there is >> > that I will cache longer other failed queries that I might not want to >> > cache. >> > >> > So basically it seems like the most elegant solution is to disable ipv6. >> > >> > Since this is Ubuntu, I added to /etc/sysctl.conf >> > #disable ipv6 >> > net.ipv6.conf.all.disable_ipv6 = 1 >> > net.ipv6.conf.default.disable_ipv6 = 1 >> > net.ipv6.conf.lo.disable_ipv6 = 1 >> > >> > and also to /etc/gai.conf >> > precedence ::ffff:0:0/96 100 >> > >> > but I still see ipv6 queries. >> > >> > hopefully you can tell me how to disable it. >> > >> > thanks! >> > >> > jonathan >> >> There's no real way to disable it but you can work around it. Resolve >> the host name first with `dns.resolve4()`, then call >> `http.get({host:'x.x.x.x', headers:{'Host':'hostname'}})` >> >> -- >> 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]<javascript:> >> To unsubscribe from this group, send email to >> [email protected] <javascript:> >> For more options, visit this group at >> http://groups.google.com/group/nodejs?hl=en?hl=en >> > > -- -- 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.
