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

Add resource manager support. Follow Kubo. #24

Merged
merged 2 commits into from
Oct 16, 2023
Merged

Conversation

hsanjuan
Copy link
Contributor

This adds libp2p resource manager support. It follows Kubo's resource manager initialization (copy-pasted mostly), as it seems dealing with a default setup has many pitfalls.

Fixes #10

@hsanjuan hsanjuan self-assigned this Oct 13, 2023

func makeResourceManagerConfig(maxMemory uint64, maxFD int, connMgrHighWater int) (limitConfig rcmgr.ConcreteLimitConfig) {
if maxMemory == 0 {
maxMemory = uint64((float64(memory.TotalMemory()) * 0.85))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

0.85 is the multiplier that current gateways are using for max-memory.

This adds libp2p resource manager support. It follows Kubo's resource manager
initialization (copy-pasted mostly), as it seems dealing with a default setup
has many pitfalls.

Fixes #10
@hsanjuan hsanjuan merged commit 38fef5d into main Oct 16, 2023
9 checks passed
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.

Add libp2p resource manager
1 participant