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

create a command for resource manager stats #8722

Closed
BigLep opened this issue Feb 8, 2022 · 1 comment · Fixed by #8735 or #8680
Closed

create a command for resource manager stats #8722

BigLep opened this issue Feb 8, 2022 · 1 comment · Fixed by #8735 or #8680
Labels
kind/feature A new feature
Milestone

Comments

@BigLep
Copy link
Contributor

BigLep commented Feb 8, 2022

What?

go-libp2p v0.18.0 adds support for the resource manager. The resource manager is already initialized in #8680, and will limit libp2p's resource usage. Optionally, the user can define new limits using a limits.json file.

What is missing here is visibility into the running system. Once we roll this out, we might get complaints from users that connections / streams are getting blocked by the rcmgr. This can either be due to too low limits (for their use case), or due to a bug in the implementation (e.g. resources not properly released).

Prior Art: filecoin-project/lotus#7969. Lotus added a netstat command, which can show the current usage of the different scopes. We should probably have something similar in IPFS.

How?

  1. We need to capture and store the pointer to the libp2p resource manager. Currently, fx only initializes it and passes the option to libp2p. We need the pointer to call the various Stat methods.
  2. ipfs net stat <scope> (I'll let others decide what exactly the name of the command should be). The <scope> should inspect the current resource usage for a scope. The scope can be all, system, transient, svc:<service-name>, proto:<protocol-name>, or peer:<peer-name>. Implementation-wise, we can probably copy-paste a lot of code from https://github.com/filecoin-project/lotus/pull/7969/files#diff-b51b680e4d6352878815055582b90d38460108021bfb6d2ac9ce297b4a0d2a5e.
  3. Bonus points if we can also properly Close the resource manager on shutdown.

Notes

This issue is part of the larger effort of integration go-libp2p v0.18.0 into go-ipfs: #8761

@BigLep BigLep added the kind/feature A new feature label Feb 8, 2022
@BigLep BigLep changed the title Placeholder for resource manager Placeholder for resource manager integration Feb 8, 2022
@marten-seemann marten-seemann changed the title Placeholder for resource manager integration create a command for resource manager stats Feb 9, 2022
@lidel
Copy link
Member

lidel commented Feb 9, 2022

🚲 🏚️ ipfs stats libp2p [scope]

@schomatis schomatis self-assigned this Feb 14, 2022
@BigLep BigLep moved this to 🔎 In Review in IPFS Shipyard Team Mar 2, 2022
@BigLep BigLep added this to the go-ipfs 0.13 milestone Mar 2, 2022
@BigLep BigLep linked a pull request Mar 7, 2022 that will close this issue
3 tasks
@schomatis schomatis removed their assignment Mar 25, 2022
Repository owner moved this from 🔎 In Review to 🎉 Done in IPFS Shipyard Team Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A new feature
Projects
No open projects
Archived in project
3 participants