Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

feat: limit connections number #1872

Merged
merged 1 commit into from
Feb 27, 2019
Merged

Conversation

vasco-santos
Copy link
Member

@vasco-santos vasco-santos commented Feb 7, 2019

In the context of libp2p/js-libp2p-kad-dht#61, the libp2p connections are now managed and the limits are configurable through the config file.

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.

Needs:

@vasco-santos vasco-santos requested review from alanshaw and removed request for alanshaw February 27, 2019 14:55
Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alanshaw alanshaw merged commit bebce7f into master Feb 27, 2019
@alanshaw alanshaw deleted the feat/limit-connections-number branch February 27, 2019 17:07
@ghost ghost removed the status/in-progress In progress label Feb 27, 2019
@alanshaw alanshaw mentioned this pull request Mar 6, 2019
50 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants