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

Inefficiencies in client connection to box (can take minutes to connect) #59

Closed
JoshuaCWebDeveloper opened this issue Nov 8, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@JoshuaCWebDeveloper
Copy link
Collaborator

Even if the client is able to connect to the box through the LAN, it can sometimes take over a minute for that connection to actually happen (during which, the user will be shown the online message).

This is due to a few observed inefficiencies:

  1. libp2p attempts to connect to a bunch of addresses that don't exist rather than attempting to connect to the addresses in the bootstrap list that it is given
  2. libp2p connects to the bootstrap addresses in a non-intuitive manner. Connections are attempted on some addresses much more frequently than others, and it can take many minutes for some addresses to even have one connection attempt
  3. Old relay addresses are never pruned (libp2p.relays never pruned #15), which causes libp2p to spend a bunch of time connecting to them (and worsening problem 2) )
  4. Relay addresses are prioritized over local addresses. So even if the client is on LAN, it will spend a bunch of time trying to connect to relays before attempting to connect directly to the box.
@HOGGL
Copy link

HOGGL commented Nov 10, 2022

When connecting, four relays are added to the libp2p peer store initially. This grows overtime with the autodial feature. For some reason internal addresses are added as peers, slowing down the connection process until they error out.

On one occasion, there were 13 relays reportedly connected. Of the ~30 addresses in the peer store (18 unique), 3 were valid external IP addresses.

It takes a couple minutes for the autodial to break, taking minutes to do what would normally take seconds. This can only be solved by reinstalling the PWA.

@JoshuaCWebDeveloper
Copy link
Collaborator Author

Inefficiency number 1 should be resolved.

@JoshuaCWebDeveloper
Copy link
Collaborator Author

Number 1 is not resolved, but has been moved to a separate issue: #86.

@JoshuaCWebDeveloper
Copy link
Collaborator Author

The remainder of this issue is fixed by samizdapp/athena#51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants