mirror of
https://github.com/libp2p/go-libp2p-resource-manager.git
synced 2025-03-24 08:10:55 +08:00
adjust memory limit multipliers for the default limiters
This commit is contained in:
parent
d22a48d4b0
commit
927d2d70b5
@ -94,15 +94,15 @@ func NewDynamicLimiter(memFraction float64, minMemory, maxMemory int64) *BasicLi
|
||||
BaseLimit: DefaultSystemBaseLimit(),
|
||||
}
|
||||
transient := &DynamicLimit{
|
||||
MinMemory: minMemory / 16,
|
||||
MaxMemory: maxMemory / 16,
|
||||
MemoryFraction: memFraction / 16,
|
||||
MinMemory: minMemory / 4,
|
||||
MaxMemory: maxMemory / 4,
|
||||
MemoryFraction: memFraction / 4,
|
||||
BaseLimit: DefaultTransientBaseLimit(),
|
||||
}
|
||||
svc := &DynamicLimit{
|
||||
MinMemory: minMemory / 2,
|
||||
MaxMemory: maxMemory / 2,
|
||||
MemoryFraction: memFraction / 2,
|
||||
MinMemory: minMemory / 4,
|
||||
MaxMemory: maxMemory / 4,
|
||||
MemoryFraction: memFraction / 4,
|
||||
BaseLimit: DefaultServiceBaseLimit(),
|
||||
}
|
||||
proto := &DynamicLimit{
|
||||
@ -112,9 +112,9 @@ func NewDynamicLimiter(memFraction float64, minMemory, maxMemory int64) *BasicLi
|
||||
BaseLimit: DefaultProtocolBaseLimit(),
|
||||
}
|
||||
peer := &DynamicLimit{
|
||||
MinMemory: minMemory / 16,
|
||||
MaxMemory: maxMemory / 16,
|
||||
MemoryFraction: memFraction / 16,
|
||||
MinMemory: minMemory / 4,
|
||||
MaxMemory: maxMemory / 4,
|
||||
MemoryFraction: memFraction / 4,
|
||||
BaseLimit: DefaultPeerBaseLimit(),
|
||||
}
|
||||
conn := &StaticLimit{
|
||||
|
@ -84,11 +84,11 @@ func newDefaultStaticLimiter(memoryCap int64) *BasicLimiter {
|
||||
BaseLimit: DefaultSystemBaseLimit(),
|
||||
}
|
||||
transient := &StaticLimit{
|
||||
Memory: memoryCap / 16,
|
||||
Memory: memoryCap / 4,
|
||||
BaseLimit: DefaultTransientBaseLimit(),
|
||||
}
|
||||
svc := &StaticLimit{
|
||||
Memory: memoryCap / 2,
|
||||
Memory: memoryCap / 4,
|
||||
BaseLimit: DefaultServiceBaseLimit(),
|
||||
}
|
||||
proto := &StaticLimit{
|
||||
@ -96,7 +96,7 @@ func newDefaultStaticLimiter(memoryCap int64) *BasicLimiter {
|
||||
BaseLimit: DefaultProtocolBaseLimit(),
|
||||
}
|
||||
peer := &StaticLimit{
|
||||
Memory: memoryCap / 16,
|
||||
Memory: memoryCap / 4,
|
||||
BaseLimit: DefaultPeerBaseLimit(),
|
||||
}
|
||||
conn := &StaticLimit{
|
||||
|
Loading…
Reference in New Issue
Block a user