[#845] object/put: Separate pools for local and remote operations
In previous implementation Object PUT used single pool of workers for local and remote ops, but these ops are heterogeneous. Use remote/local pool for remote/local operations in PUT service. At first the pools are configured with the same size. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
3b2b6007c6
commit
ee20200c2e
5 changed files with 25 additions and 10 deletions
|
@ -16,7 +16,7 @@ import (
|
|||
type distributedTarget struct {
|
||||
traverseOpts []placement.Option
|
||||
|
||||
workerPool util.WorkerPool
|
||||
remotePool, localPool util.WorkerPool
|
||||
|
||||
obj *object.RawObject
|
||||
|
||||
|
@ -129,7 +129,15 @@ loop:
|
|||
|
||||
isLocal := t.isLocalKey(addr.Key())
|
||||
|
||||
if err := t.workerPool.Submit(func() {
|
||||
var workerPool util.WorkerPool
|
||||
|
||||
if isLocal {
|
||||
workerPool = t.localPool
|
||||
} else {
|
||||
workerPool = t.remotePool
|
||||
}
|
||||
|
||||
if err := workerPool.Submit(func() {
|
||||
defer wg.Done()
|
||||
|
||||
if err := f(nodeDesc{local: isLocal, info: addr}); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue