-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
libp2p v0.18.0-rc1 and initial resource manager integration #7969
Conversation
The bug was in yamux memory accounting, fix is here: libp2p/go-yamux#77 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good. Not sure why linter complains. Also need more make gen
That linter seems psychotic -- it is failing because of a test file in go-fil-markets that has broken because of mocknet api changes in go-libp2p. |
Codecov Report
@@ Coverage Diff @@
## master #7969 +/- ##
==========================================
- Coverage 39.31% 39.16% -0.15%
==========================================
Files 658 660 +2
Lines 71134 71408 +274
==========================================
+ Hits 27965 27966 +1
- Misses 38348 38613 +265
- Partials 4821 4829 +8
Continue to review full report at Codecov.
|
This upgrades libp2p to v0.18.0-rc1 (and pubsub to v0.6.1 fixing a leak while at it), and provides initial resource manager integration.
Note: there is a (non catastrophic) bug in our memory accounting somewhere in the stack, which results in log warnings about too much memory released.This can be ignored for now, but I will try to get it fixed asap.
Edit: the bug has been fixed in go-yamux v3.0.2
The libp2p Resource Manager
With libp2p-v0.18.0-rc1 we introduce the resource manager, which accounts for and limits and resources used by the libp2p network stack.
See the resource manager repo for design notes and implementation.
This is the initial integration, whereby we initialize a resource manager and provide APIs for inspecting resource usage and setting limits.
In a subsequent pr we will also augment lotus network services to make their resources accountable by the resource manager by organizing them in logical services.
New APIs/Commands
We add the following APIs/cli commands:
lotus net stat <scope>
-- this allows you to inspect current resource usage for a scaope. The scope can beall
,system
,transient
,svc:<service-name>
,proto:<protocol-name>
, orpeer:<peer-name>
lotus limit [--set] <scope> [<limit>]
-- this allows you to inspect or set the current limit for a scope. The scope can be as above while thelimit
is a json representation of a limit; see below for the format.Limit Configuration
The user can override the default limits by placing a
limits.json
file in.lotus
.This file has the following format, with all limits optional and retaining their default value if omitted:
Limit objects specify memory and stream/connection/fd limits. Memory can be either a fixed number (in bytes), a fraction (with min and max in bytes) of total of total memory, or a dynamically computed fraction (with min and max in bytes) of free memory at the time of check.
The object has the following format in json: