-
Notifications
You must be signed in to change notification settings - Fork 4
Conversation
b86fdde
to
07c38a5
Compare
07c38a5
to
c45d467
Compare
@vyzo This should be ready for review now. |
c45d467
to
ec37448
Compare
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.
see the comment.
8f2d1ba
to
8593b43
Compare
@marten-seemann : what are the next steps here? Would it help to have @MarcoPolo review? |
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 okay. Just some minor nits. I feel like this is really only useful for helping set up good defaults, but I think users will probably use the fixed limits when tuning this themselves.
} | ||
|
||
func (l *BasicLimiter) GetServicePeerLimits(svc string) Limit { | ||
pl, ok := l.ServicePeerLimits[svc] | ||
func (l *fixedLimiter) GetServiceLimits(svc string) Limit { |
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.
Not for this PR, but I would like a method for Limiter that iterates over all limits so that we can expose this information to the use (via opencensus or something else).
Maybe something like GetAllLimits(forEach func(scopeName string, Limit))
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.
This would be good to log at the start as well since it can be a bit confusing what the final values are at the end of the day.
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.
I would like this in to help debugging :)
StreamMemory int64 | ||
// Scale scales up a limit configuration. | ||
// memory is the amount of memory that the stack is allowed to consume, | ||
// for a full it's recommended to use 1/8 of the installed system memory. |
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.
// for a full it's recommended to use 1/8 of the installed system memory. | |
// for a node dedicated to this process it's recommended to use 1/8 of the installed system memory. |
118a286
to
58fa159
Compare
@vyzo Could you please review this again? I'll be merging this PR tomorrow (Thu) by EOD. |
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.
I still dont see how the user can do full manual specification, which is a feature we need to retain support for.
Auto* stuff have a tendency to do unpredictable things.
@@ -20,19 +23,6 @@ type Limit interface { | |||
GetConnTotalLimit() int | |||
// GetFDLimit returns the file descriptor limit. | |||
GetFDLimit() int | |||
|
|||
// WithMemoryLimit creates a copy of this limit object, with memory limit adjusted to |
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.
can we please keep the prototype constructors for limit in some form?
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.
These are not constructors. They’re methods on an interface, where they don’t belong.
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.
they are prototype OO constructors hich allow you to easily adjust parts of the limit without knowing the concrete types.
They belong just fine, please provide them or a suitable replacement.
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.
I haven't found any use for them. They conflate scaling and limit configuration. Disentangling those made this PR so invasive, but ultimately resulted in a cleaner structure.
|
I can't approve this as is. This is too much of a breaking change without providing replacement for anything it is removing. I want autoscaling too, but this is flat out throwing everything else away, including the baby with the bathwater. |
I don't understand what you're missing here. This builds with go-ipfs, proving that there's nothing left in the API. |
2022-07-01 conversation: We need a README update that discusses:
We're also going to log the limits that the resource manager was configured with. |
and i must insist on having prototype adjustment in the limit interface. Also, it must be made abundantly clear how we can do full manual control, the functionality that was previously provided and seems gone now. As it is, it adds a desirable feature but on the same time regresses on fuma control. |
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.
Let's get this in. I don't think it'll break existing use cases because:
- Users can still pass in limits from a json config.
- Users can define a custom limit config and merge it with the autoscale defaults.
- Users can modify a limit by modifying the LimitConfig instead of the prototype methods.
And we get some new functionality around scaling. And net less code (nice work!).
I would like the log of what the limits are, but it's really not a blocker for this PR so feel free to do in a separate PR along with Steve's suggestions above.
58fa159
to
7ceb0b8
Compare
Rebased on top of master. |
Merging this PR. There'll be some follow up PRs for documentation and FD counting on Windows. |
@marten-seemann : are there issues for the followup work? I'm interested in the doc items for showing what the user experience is going to be like for anyone configuring the resource manager. |
We want to be able to auto-scale our limits so that 99% of node operators don't need to worry about them.
To do so, this PR removes dynamic limits, which, to the best of our knowledge, have not been used. Using them would be challenging anyway due to complicated interactions between resource manager and connection manager.
The
ScalingLimitConfig
is what makes this auto-scaling possible (and configurable). It defines both the minimum resource requirements for a libp2p node (assuming 1 GB of system memory, of which 128 MB are reserved for libp2p), e.g. inSystemBaseLimit
. InSystemLimitIncrease
one then specifies how many connections / streams / memory is added _for every additional GB of memory.As a convenience function, the
ScalingLimitConfig
defines aAutoScale
function that queries the system for available memory / FDs. Light nodes (IPFS desktop for example) can use theScale
function and pass in lower values of memory / FDs, to obtain a more lightweight resource manager.