forked from TrueCloudLab/frostfs-node
[#674] object/put: Use pseudo worker pool for local operations
After storage engine started to limit number of PUT operations there is no need to limited worker pool in Object Put service. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
07130855aa
commit
40a4a7faa2
8 changed files with 5 additions and 27 deletions
|
@ -193,7 +193,7 @@ type cfgLocalStorage struct {
|
|||
}
|
||||
|
||||
type cfgObjectRoutines struct {
|
||||
putRemote, putLocal *ants.Pool
|
||||
putRemote *ants.Pool
|
||||
}
|
||||
|
||||
type cfgControlService struct {
|
||||
|
@ -441,11 +441,6 @@ func initObjectPool(cfg *config.Config) (pool cfgObjectRoutines) {
|
|||
fatalOnErr(err)
|
||||
}
|
||||
|
||||
pool.putLocal, err = ants.NewPool(objectconfig.Put(cfg).PoolSizeLocal(), optNonBlocking)
|
||||
if err != nil {
|
||||
fatalOnErr(err)
|
||||
}
|
||||
|
||||
return pool
|
||||
}
|
||||
|
||||
|
|
|
@ -39,15 +39,3 @@ func (g PutConfig) PoolSizeRemote() int {
|
|||
|
||||
return PutPoolSizeDefault
|
||||
}
|
||||
|
||||
// PoolSizeLocal returns value of "pool_size_local" config parameter.
|
||||
//
|
||||
// Returns PutPoolSizeDefault if value is not positive number.
|
||||
func (g PutConfig) PoolSizeLocal() int {
|
||||
v := config.Int(g.cfg, "pool_size_local")
|
||||
if v > 0 {
|
||||
return int(v)
|
||||
}
|
||||
|
||||
return PutPoolSizeDefault
|
||||
}
|
||||
|
|
|
@ -14,14 +14,12 @@ func TestObjectSection(t *testing.T) {
|
|||
empty := configtest.EmptyConfig()
|
||||
|
||||
require.Equal(t, objectconfig.PutPoolSizeDefault, objectconfig.Put(empty).PoolSizeRemote())
|
||||
require.Equal(t, objectconfig.PutPoolSizeDefault, objectconfig.Put(empty).PoolSizeLocal())
|
||||
})
|
||||
|
||||
const path = "../../../../config/example/node"
|
||||
|
||||
var fileConfigTest = func(c *config.Config) {
|
||||
require.Equal(t, 100, objectconfig.Put(c).PoolSizeRemote())
|
||||
require.Equal(t, 101, objectconfig.Put(c).PoolSizeLocal())
|
||||
}
|
||||
|
||||
configtest.ForEachFileType(path, fileConfigTest)
|
||||
|
|
|
@ -281,7 +281,7 @@ func initObjectService(c *cfg) {
|
|||
objectCore.WithDeleteHandler(objInhumer),
|
||||
),
|
||||
putsvc.WithNetworkState(c.cfgNetmap.state),
|
||||
putsvc.WithWorkerPools(c.cfgObject.pool.putRemote, c.cfgObject.pool.putLocal),
|
||||
putsvc.WithWorkerPools(c.cfgObject.pool.putRemote),
|
||||
putsvc.WithLogger(c.log),
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue