Why ipns is so slow

It usually takes 2~ minutes for command ipfs name publish <hash-id>(running on my local). And also more 2 minutes for ipfs name resolve <peer-id>(running on my digitalocean vps).

I believe this is a common issue that is kinda being worked on.

+1 IPNS is technically working, but loading so slowly, as to be un-useable.

This link is taking around a minute to load: https://gateway.ipfs.io/ipns/QmbZXsh6GpQX1VEwW4cBCBcLAZRLEbmYkjcBuTMrTDEKBt/

Try out the --enable-namesys-pubsub daemon option in v0.4.14.

I try ipfs daemon --enable-namesys-pubsub and ipfs add -r *** and ipfs name publish *** and time ipfs name resolve ***

There is still so slow, why?

real 1m2.526s
user 0m0.044s
sys 0m0.007s

Are you publishing and resolving from the same machine? If not, is the namesys pubsub option enabled on both of them?

Have a look here: https://github.com/ipfs/go-ipfs/issues/3860

Yes, it’s the same server, Ubuntu 16.04. IPFS 0.4.14. And ipfs name pubsub state shows enabled.
I don’t know what’s I missing or mistaking?

I don’t think you’re missing anything. It might be worth posting in one of the existing IPNS slowness issues that even using the --enable-namesys-pubsub option is still slow in at least some cases.

I’m just realizing that when I initially tested this my tests were probably invalid since they probably weren’t testing IPNS in the first place – rather just dnslink lookups. My tests before were doing things like running ipns name resolve -r /ipns/ipfs.io which I don’t think is actually doing an IPNS lookup since the dnslink for the domains I was testing are pointing to /ipfs/ paths (not /ipns/).

Yes, I try:

time ipfs name resolve -r /ipns/ipfs.io
/ipfs/QmYNQJoKGNHTpPxCBPh9KkDpaExgd2duMa3aF6ytMpHdao

real    0m0.124s
user    0m0.038s
sys     0m0.015s

And, try:

time ipfs name resolve -r /ipns/dengcb.net
/ipfs/QmSa2yvX9ptimCLT66dGbDAunWiS3DCEhBxU9WoXPnz1YP

real    1m29.312s
user    0m0.040s
sys     0m0.010s

Yeah, that seems to be the difference. One is using an IPNS address and the other isn’t.

$ dig txt +short dengcb.net
"dnslink=/ipns/Qmdn4vrHjbmsQvHPXAiJvWFHQRqGd5fP33HJqd9AE4EjMH"
$ dig txt +short ipfs.io
"dnslink=/ipfs/QmYNQJoKGNHTpPxCBPh9KkDpaExgd2duMa3aF6ytMpHdao"