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

Public gateway slow to open uploads made via embedded js-ipfs node #490

Closed
lidel opened this issue May 30, 2018 · 2 comments · Fixed by #547
Closed

Public gateway slow to open uploads made via embedded js-ipfs node #490

lidel opened this issue May 30, 2018 · 2 comments · Fixed by #547
Assignees
Labels
help wanted Seeking public contribution on this issue kind/discussion Topical discussion; usually not changes to codebase P1 High: Likely tackled by core team if no one steps up status/blocked/upstream-bug Blocked by upstream bugs

Comments

@lidel
Copy link
Member

lidel commented May 30, 2018

Background

In the past, "quick uploads" via js-ipfs were near-instant because default bootstrap nodes were also the same nodes that provide public gateway.

In recent weeks this changed, and it looks that we are experiencing consequences of separating bootstrap nodes from the gateway function: upload ends with long wait for gateway.

Upstream issue: JS-IPFS now incompatible with ipfs.io gateway ipfs/js-ipfs#1380

How To Replicate

  1. Install latest release or beta of our browser extension
  2. Switch to embedded node (js-ipfs)
  3. Upload a file that was not yet on IPFS (to be sure it was not cached by the gateway)
  4. Wait for resource to be opened from the public gateway

Current Behavior

Step 4 takes forever. It is not slow. It just stopped working.

Expected Behavior

Step 4 takes a few seconds max, like it did in the past.

Possible Mitigations

Circuit Relaying

  • While basic circuit-relaying is available, a mechanism for discovering relay nodes does not exist yet.
  • According to the RELAY spec, for the time being, relay nodes. should be listed in config statically.
  • Caveat: Currently a Relay will only work if it already has a connection to the STOP node
    • Based on local experimentation with PoC setup (js-ipfs in browser extension + go-ipfs on locahost/ws as a relay) it works, but preexisting connection to the STOP node is a limiting factor. Especially problematic on go-ipfs, where connection can be garbadge-collected by ConnMgr.

My understanding is that to improve things, we would have to:

  1. enable relay on bootstrap servers listed in default config of js-ipfs
  2. ensure relays maintain connections to public gateway(s)

Questions:

  • Are we able to improve the situation by enabling use of Circuit Relaying in default config?
    • Is there a set of public relays that are safe to be put in default config of js-ipfs shipped with browser extension?
  • Is there anything else we could do to improve situation?
@lidel lidel added kind/discussion Topical discussion; usually not changes to codebase UX help wanted Seeking public contribution on this issue labels May 30, 2018
@lidel lidel changed the title Broken or slow uploads via embedded node (js-ipfs) Slow public gateway when opening uploads made via embedded node (js-ipfs) May 30, 2018
@lidel lidel changed the title Slow public gateway when opening uploads made via embedded node (js-ipfs) Public gateway slow to open uploads made via embedded js-ipfs node May 30, 2018
@lidel lidel added status/blocked/upstream-bug Blocked by upstream bugs P1 High: Likely tackled by core team if no one steps up labels Jun 4, 2018
@hazae41
Copy link

hazae41 commented Jul 26, 2018

I think it is because there is not enough pairs connected when using the embedded version

@lidel
Copy link
Member Author

lidel commented Jul 26, 2018

Ack. It will take time to get DHT and proper relay discovery, so js-ipfs team is working on a solution that will restore "realtime feel" in browser contexts: ipfs/js-ipfs#1459 / ipfs/js-ipfs#1459 (comment)

As soon it lands in a new js-ipfs release, we will switch companion to that version.

@lidel lidel self-assigned this Jul 26, 2018
lidel added a commit that referenced this issue Jul 29, 2018
- js-ipfs v0.31 ships with preload by default
- closes #490
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue kind/discussion Topical discussion; usually not changes to codebase P1 High: Likely tackled by core team if no one steps up status/blocked/upstream-bug Blocked by upstream bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants