forked from TrueCloudLab/frostfs-node
[#428] engine: Add low_mem config parameter
Concurrent initialization in case of the metabase resync leads to high memory consumption and potential OOM. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
71a63b8e9c
commit
cac4ed93d6
7 changed files with 44 additions and 10 deletions
|
@ -210,6 +210,8 @@ type cfg struct {
|
|||
metrics MetricRegister
|
||||
|
||||
shardPoolSize uint32
|
||||
|
||||
lowMem bool
|
||||
}
|
||||
|
||||
func defaultCfg() *cfg {
|
||||
|
@ -265,3 +267,10 @@ func WithErrorThreshold(sz uint32) Option {
|
|||
c.errorsThreshold = sz
|
||||
}
|
||||
}
|
||||
|
||||
// WithLowMemoryConsumption returns an option to set the flag to reduce memory consumption by reducing performance.
|
||||
func WithLowMemoryConsumption(lowMemCons bool) Option {
|
||||
return func(c *cfg) {
|
||||
c.lowMem = lowMemCons
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue