Skip to content

feat: default minimum and maximum connections #828

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

Merged
merged 2 commits into from
Feb 18, 2019
Merged

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Feb 17, 2019

Set the range to 200-300. The default was 300-600. Ref: #665

License: MIT
Signed-off-by: Henrique Dias [email protected]

License: MIT
Signed-off-by: Henrique Dias <[email protected]>
@hacdias hacdias requested a review from lidel February 17, 2019 10:10
@ghost ghost assigned hacdias Feb 17, 2019
@ghost ghost added the in progress label Feb 17, 2019
@olizilla
Copy link
Member

olizilla commented Feb 18, 2019

I'm in favour of this change, but for posterity, we should replace it with a desktop profile in IPFS core when it is available ipfs/kubo#4989

Some initial thoughts for a desktop user:

  • probably want dhtclient. Most desktop users are behind NAT, and it's better to default assume NAT's arent traversable
  • connection manager limits probably want to be low (50-150 ish) but with a higher grace period, perhaps several minutes.
  • mdns and NAT port mapping should be enabled
  • relay addresses should be advertised

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

What if user changes HighWater via Settings in Web UI?
IIUC this will override configuration on every start, confusing users trying to change this value.

Would it be possible to run it only once (eg. after ipfs init)?
That way it will feel more like profile proposed in ipfs/kubo#4989

@olizilla
Copy link
Member

@lidel good news, the logic only runs on init!

https://github.com/ipfs-shipyard/ipfs-desktop/blob/62317e02bb6f534c5806c0c6c204bfacf09999e7/src/utils/daemon.js#L39-L41

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

Ah, my bad. Looks good then!
We coukd ensure mDNS is enabled too (in case default in go-ipfs chcnges), but that can be separate PR.

@olizilla
Copy link
Member

olizilla commented Feb 18, 2019

From @whyrusleeping notes it sounds like we should set the ConnMgr values to

"LowWater": 50,
"HighWater": 200,
"GracePeriod": "300s"

Otherwise

  • Discovery.MDNS.enabled is true` by default
  • Swarm.DisableNatPortMap is false by default

but we could explicitly set them here. I'm not sure what we'd need to change to ensure

relay addresses should be advertised

License: MIT
Signed-off-by: Henrique Dias <[email protected]>
@hacdias hacdias merged commit de00907 into master Feb 18, 2019
@hacdias hacdias deleted the feat/default-connmgr branch February 18, 2019 18:33
@ghost ghost removed the in progress label Feb 18, 2019
@hacdias
Copy link
Member Author

hacdias commented Feb 18, 2019

Merging this now with the defaults decided here. Let's hope a desktop profile is created soon so we can just use it! 😄

@lidel lidel mentioned this pull request Feb 19, 2019
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants