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

need to be smarter about dialing (again) #1689

Closed
whyrusleeping opened this issue Sep 11, 2015 · 6 comments
Closed

need to be smarter about dialing (again) #1689

whyrusleeping opened this issue Sep 11, 2015 · 6 comments
Labels
kind/bug A bug in existing code (including security flaws) topic/libp2p Topic libp2p

Comments

@whyrusleeping
Copy link
Member

We now have well over 200 nodes in the network. When adding large files (or lots of files) we frequently try to dial a lot of them, our dial limit is 10 addresses per peer, concurrently. Doing the math, thats 2000 sockets in the 'best' case, but since we have our own dial implementation, we have extra epoll fds sitting around. So its quite easy to hit that tiny little 1024 fd limit.

We should do a few things:

Dialing:

  • lower the concurrent dial limit. to 5? (or maybe even 3)
  • be smarter about dialing
    • localhost addresses should complete immediately, probably high priority
    • addresses on our own LAN should complete fairly quickly
    • addresses on other LANs should probably not be dialed, or at least prioritized lower
    • if we have a bunch of addresses that are the same ip with different ports, we should try and handle those differently.
  • switch to udp-based! (udp will only need a single fd for all connections)
  • disconnect from peers, no need to stay connected to every peer forever
@whyrusleeping whyrusleeping added kind/bug A bug in existing code (including security flaws) topic/libp2p Topic libp2p labels Sep 11, 2015
@jbenet
Copy link
Member

jbenet commented Sep 14, 2015

All of those +1.

I think the best solution is UDP.

TODO:

@cryptix
Copy link
Contributor

cryptix commented Oct 1, 2015

Bump to stop dialing outselvs.

@BrendanBenshoof
Copy link

Another big thing you can do (if you are not already) is batching storage of blocks.

I designed a "batch store" algorithm a while back you could use here.

@jbenet
Copy link
Member

jbenet commented Oct 1, 2015

@BrendanBenshoof this is unrelated to this problem. and should be addressed in a completely different layer

@whyrusleeping
Copy link
Member Author

we have since implemented a much smarter dial limiter and scheduler, this isnt as much of an issue anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) topic/libp2p Topic libp2p
Projects
None yet
Development

No branches or pull requests

4 participants