[#194] cmd/neofs-node: Use non-blocking worker pools for Object services
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
46dab77705
commit
d286824d1d
1 changed files with 8 additions and 6 deletions
|
@ -421,32 +421,34 @@ func initBucket(prefix string, c *cfg) (bucket bucket.Bucket, err error) {
|
||||||
func initObjectPool(cfg *viper.Viper) (pool cfgObjectRoutines) {
|
func initObjectPool(cfg *viper.Viper) (pool cfgObjectRoutines) {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
pool.get, err = ants.NewPool(cfg.GetInt(cfgObjectGetPoolSize))
|
optNonBlocking := ants.WithNonblocking(true)
|
||||||
|
|
||||||
|
pool.get, err = ants.NewPool(cfg.GetInt(cfgObjectGetPoolSize), optNonBlocking)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatalOnErr(err)
|
fatalOnErr(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
pool.head, err = ants.NewPool(cfg.GetInt(cfgObjectHeadPoolSize))
|
pool.head, err = ants.NewPool(cfg.GetInt(cfgObjectHeadPoolSize), optNonBlocking)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatalOnErr(err)
|
fatalOnErr(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
pool.search, err = ants.NewPool(cfg.GetInt(cfgObjectSearchPoolSize))
|
pool.search, err = ants.NewPool(cfg.GetInt(cfgObjectSearchPoolSize), optNonBlocking)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatalOnErr(err)
|
fatalOnErr(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
pool.put, err = ants.NewPool(cfg.GetInt(cfgObjectPutPoolSize))
|
pool.put, err = ants.NewPool(cfg.GetInt(cfgObjectPutPoolSize), optNonBlocking)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatalOnErr(err)
|
fatalOnErr(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
pool.rng, err = ants.NewPool(cfg.GetInt(cfgObjectRangePoolSize))
|
pool.rng, err = ants.NewPool(cfg.GetInt(cfgObjectRangePoolSize), optNonBlocking)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatalOnErr(err)
|
fatalOnErr(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
pool.rngHash, err = ants.NewPool(cfg.GetInt(cfgObjectRangeHashPoolSize))
|
pool.rngHash, err = ants.NewPool(cfg.GetInt(cfgObjectRangeHashPoolSize), optNonBlocking)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatalOnErr(err)
|
fatalOnErr(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue