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

feat(connmgr): lower the default connection pool #9467

Merged
merged 1 commit into from
Dec 7, 2022

Conversation

lidel
Copy link
Member

@lidel lidel commented Dec 7, 2022

This PR aims to close #9420 by lowering the implicit defaults for Swarm.ConnMgr.

Rationale

It will not only help with #9442 but also decrease bitswap gossip.

To apply change to legacy nodes that were initialized before #8913, we need to perform config migration described in #8913 (review)

TODO

@lidel lidel self-assigned this Dec 7, 2022
@lidel lidel changed the title feat: lower connection pool feat(connmgr): lower connection pool Dec 7, 2022
@lidel lidel marked this pull request as ready for review December 7, 2022 20:38
Copy link
Contributor

@Jorropo Jorropo left a comment

Choose a reason for hiding this comment

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

LGTM

@lidel lidel changed the title feat(connmgr): lower connection pool feat(connmgr): lower the default connection pool Dec 7, 2022
@lidel lidel merged commit e0e4741 into master Dec 7, 2022
@lidel lidel deleted the feat/lower-connection-pool branch December 7, 2022 22:00
@BigLep
Copy link
Contributor

BigLep commented Dec 7, 2022

@lidel : I sanity checked the number of Low=50, High=150

By default if a Kubo node has 8GB of total memory, a maxMemory for libp2p will be set to 2GB. That will cause System.ConnsInbound to be 128 I believe (looks like 64 per GB of memory here: https://github.com/libp2p/go-libp2p/blob/master/p2p/host/resource-manager/limit_defaults.go#L345 since Kubo is using those same libp2p defaults: https://github.com/ipfs/kubo/blob/master/core/node/libp2p/rcmgr_defaults.go#L94). As a result, in this particular setup, our high water mark may not get hit (unless there are sufficient outbound connections). I know there isn't a perfect number here and we have no stats on the systems that folks are using. I would be in favor of dropping the ConnMgr.High to 120 instead.

lidel added a commit to ipfs/fs-repo-migrations that referenced this pull request Dec 7, 2022
lidel added a commit that referenced this pull request Dec 8, 2022
@lidel
Copy link
Member Author

lidel commented Dec 8, 2022

Continued in #9483

lidel added a commit to ipfs/fs-repo-migrations that referenced this pull request Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Lower default connection limits (Swarm.ConnMgr)
3 participants