-
- Downloads
feat: opt-in Swarm.ResourceMgr (go-libp2p v0.18) (#8680)
* update go-libp2p to v0.18.0
* initialize the resource manager
* add resource manager stats/limit commands
* load limit file when building resource manager
* log absent limit file
* write rcmgr to file when IPFS_DEBUG_RCMGR is set
* fix: mark swarm limit|stats as experimental
* feat(cfg): opt-in Swarm.ResourceMgr
This ensures we can safely test the resource manager without impacting
default behavior.
- Resource manager is disabled by default
- Default for Swarm.ResourceMgr.Enabled is false for now
- Swarm.ResourceMgr.Limits allows user to tweak limits per specific
scope in a way that is persisted across restarts
- 'ipfs swarm limit system' outputs human-readable json
- 'ipfs swarm limit system new-limits.json' sets new runtime limits
(but does not change Swarm.ResourceMgr.Limits in the config)
Conventions to make libp2p devs life easier:
- 'IPFS_RCMGR=1 ipfs daemon' overrides the config and enables resource manager
- 'limit.json' overrides implicit defaults from libp2p (if present)
* docs(config): small tweaks
* fix: skip libp2p.ResourceManager if disabled
This ensures 'ipfs swarm limit|stats' work only when enabled.
* fix: use NullResourceManager when disabled
This reverts commit b19f7c9eca4cee4187f8cba3389dc2c930258512.
after clarification feedback from
https://github.com/ipfs/go-ipfs/pull/8680#discussion_r841680182
* style: rename IPFS_RCMGR to LIBP2P_RCMGR
preexisting libp2p toggles use LIBP2P_ prefix
* test: Swarm.ResourceMgr
* fix: location of opt-in limit.json and rcmgr.json.gz
Places these files inside of IPFS_PATH
* Update docs/config.md
* feat: expose rcmgr metrics when enabled (#8785)
* add metrics for the resource manager
* export protocol and service name in Prometheus metrics
* fix: expose rcmgr metrics only when enabled
Co-authored-by:
Marcin Rataj <lidel@lidel.org>
* refactor: rcmgr_metrics.go
* refactor: rcmgr_defaults.go
This file defines implicit limit defaults used when Swarm.ResourceMgr.Enabled
We keep vendored copy to ensure go-ipfs is not impacted when go-libp2p
decides to change defaults in any of the future releases.
* refactor: adjustedDefaultLimits
Cleans up the way we initialize defaults and adds a fix for case
when connection manager runs with high limits.
It also hides `Swarm.ResourceMgr.Limits` until we have a better
understanding what syntax makes sense.
* chore: cleanup after a review
* fix: restore go-ipld-prime v0.14.2
* fix: restore go-ds-flatfs v0.5.1
Co-authored-by:
Lucas Molas <schomatis@gmail.com>
Co-authored-by:
Marcin Rataj <lidel@lidel.org>
Showing
- config/swarm.go 59 additions, 0 deletionsconfig/swarm.go
- core/commands/commands_test.go 2 additions, 0 deletionscore/commands/commands_test.go
- core/commands/config.go 11 additions, 9 deletionscore/commands/config.go
- core/commands/swarm.go 139 additions, 6 deletionscore/commands/swarm.go
- core/core.go 13 additions, 11 deletionscore/core.go
- core/coreapi/test/api_test.go 2 additions, 2 deletionscore/coreapi/test/api_test.go
- core/mock/mock.go 2 additions, 4 deletionscore/mock/mock.go
- core/node/groups.go 6 additions, 4 deletionscore/node/groups.go
- core/node/libp2p/libp2p.go 5 additions, 2 deletionscore/node/libp2p/libp2p.go
- core/node/libp2p/rcmgr.go 368 additions, 0 deletionscore/node/libp2p/rcmgr.go
- core/node/libp2p/rcmgr_defaults.go 313 additions, 0 deletionscore/node/libp2p/rcmgr_defaults.go
- core/node/libp2p/rcmgr_metrics.go 239 additions, 0 deletionscore/node/libp2p/rcmgr_metrics.go
- core/node/libp2p/smux.go 2 additions, 2 deletionscore/node/libp2p/smux.go
- docs/config.md 64 additions, 0 deletionsdocs/config.md
- docs/environment-variables.md 27 additions, 11 deletionsdocs/environment-variables.md
- go.mod 13 additions, 12 deletionsgo.mod
- go.sum 88 additions, 28 deletionsgo.sum
- peering/peering_test.go 9 additions, 7 deletionspeering/peering_test.go
- test/integration/addcat_test.go 3 additions, 3 deletionstest/integration/addcat_test.go
- test/integration/bench_cat_test.go 2 additions, 2 deletionstest/integration/bench_cat_test.go
Loading
Please sign in to comment