-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
namesys: IPNS/DNS resolution is very slow #2934
Comments
That's due to the overhead of the DNS lookup and the lack of DNS caching. Assuming you already have the IPFS blocks cached on your local node, the IPFS lookup doesn't make any network requests. However, assuming you don't have a caching DNS server (e.g., dnsmasq) on your local node, you have to make a DNS lookup every time you lookup One solution is to have the IPFS daemon cache DNS results. However, many modern operating systems (Windows, MacOS Ubuntu), come with DNS caching servers so this may be redundant in most cases (although, caching within the IPFS daemon it would shave off a few milliseconds at the cost of some complexity). Try setting up something like dnsmasq and trying again. |
That's 10x faster than it was before but still 10x slower than it could be. A simple, tiny LRU cache (and some synchronization mechanism to avoid parallel lookups of the same domain) in namesys should help significantly. Note: For some reason, the DNS resolver in |
I noticed this being really slow when playing with a browser extension. Would be really cool to have this done soon |
I can try doing it soon (TM), the solution is to revive solution which we had some time ago that is using TTL wherever we can in combination with browser caches and etags. |
Update: We set up dns caching on the ipfs.io gateways, things are a bit faster. Given go's current APIs we cant easily get dns ttls back from a resolve call, so doing caching inside go-ipfs isnt yet feasible. |
@cpacia did some work on making the dns resolver pluggable. I wonder if we could do something along those lines to add caching internally to ipfs |
@Stebalien @whyrusleeping I'm interested in helping out on this, what's the current state of play? |
@dirkmc DHT query perf (from the other issue) is the biggest one. Some other things that would help though:
|
@whyrusleeping ipns still seems to be slow for me, would setting the --ttl flag help? |
@Cole128 sorry, this is a deeper issue than just adding a flag. We're working on it, and will post updates here as we improve things. |
Alright, I'll watch this thread. What will the ttl flag do? |
After a day or two, it doesn't actually seem to work better. Timing the command line resolve is fast, but actually accessing it in my browser is slow the first time, but then speeds up, even if I do a hard refresh. |
I created an issue to discuss the suggestion of a command line parameter to specify the number of IPNS records to retrieve from the DHT: #4723 |
I would just like to point out that this issue was initially created about performance of IPNS->DNS |
Not sure if this is still relevant, but:
|
While checking performance I discovered that namesys introduces 400x to 5000x increased latency.
See:
IPFS path:
IPNS path:
I did hard refresh so e-tag and in browser caching shouldn't matter.
Complete load requires almost 40x more time to complete under IPNS. I can repeat those results easily. You can also try for your self: fs:/ipns/ipfs.io and fs:/ipfs/QmTzQ1JRkWErjk39mryYw2WVaphAZNAREyMchXzYQ7c15n/
The text was updated successfully, but these errors were encountered: