Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Discovered too many peers? #61

Open
alanshaw opened this issue Dec 11, 2018 · 4 comments
Open

Discovered too many peers? #61

alanshaw opened this issue Dec 11, 2018 · 4 comments
Assignees
Labels
kind/bug A bug in existing code (including security flaws) P0 Critical: Tackled by core team ASAP status/in-progress In progress

Comments

@alanshaw
Copy link
Member

screenshot 2018-12-10 at 14 37 50

I mean, this is 😎, but I don't think there's that many peers on the network. At this same time my go-ipfs node was settling on ~800 nodes.

@vasco-santos vasco-santos added kind/bug A bug in existing code (including security flaws) status/ready Ready to be worked P0 Critical: Tackled by core team ASAP labels Dec 11, 2018
@lidel
Copy link
Member

lidel commented Dec 11, 2018

Companion just counts the number of entries returned by ipfs.swarm.peers() :)
I think 3k peers will really happen if you disable connection manager in go-ipfs.

So my guess is that either:

  • (A) ipfs.swarm.peers() returns invalid/duplicate entries or gets mangled somehow,
  • (B) peer count is valid and enabling DHT in js-ipfs surfaced the need for enforcing connection manager limits by default just like go-ipfs does 🙃

Excerpt from release notes of go-ipfs v0.4.12:

The most critical change is the 'Connection Manager': it allows an ipfs node to maintain a limited set of connections to other peers in the network. By default (and with no config changes required by the user), ipfs nodes will now try to maintain between 600 and 900 open connections. These limits are still likely higher than needed, and future releases may lower the default recommendation, but for now we want to make changes gradually. The rationale for this selection of numbers is as follows:

  • The DHT routing table for a large network may rise to around 400 peers
  • Bitswap connections tend to be separate from the DHT
  • PubSub connections also generally are another distinct set of peers (including js-ipfs nodes)

Because of this, we selected 600 as a LowWater number, and 900 as a HighWater number to avoid having to clear out connections too frequently. You can configure different numbers as you see fit via the Swarm.ConnMgr field in your ipfs config file. See here for more details.

@alanshaw
Copy link
Member Author

Incredible knowledge @lidel as usual ❤️

@ghost ghost assigned vasco-santos Dec 24, 2018
@ghost ghost added status/in-progress In progress and removed status/ready Ready to be worked labels Dec 24, 2018
@x5engine
Copy link

I only have 35 peers come on! I need more like you!!!

@vasco-santos
Copy link
Member

How are you testing this @x5engine ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug A bug in existing code (including security flaws) P0 Critical: Tackled by core team ASAP status/in-progress In progress
Projects
None yet
Development

No branches or pull requests

4 participants