[#674] node: Configure size of per-shard worker pools

Add `shard_pool_size` config to `storage` section. Set app default to 20.
Pass the value to `WithShardPoolSize` option.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-10-08 16:25:56 +03:00 committed by Alex Vanin
parent 5b1975d52a
commit 2126235f0e
6 changed files with 35 additions and 3 deletions

View file

@ -318,7 +318,10 @@ func (c *cfg) LocalAddress() network.AddressGroup {
func initLocalStorage(c *cfg) {
initShardOptions(c)
engineOpts := []engine.Option{engine.WithLogger(c.log)}
engineOpts := []engine.Option{
engine.WithLogger(c.log),
engine.WithShardPoolSize(engineconfig.ShardPoolSize(c.appCfg)),
}
if c.metricsCollector != nil {
engineOpts = append(engineOpts, engine.WithMetrics(c.metricsCollector))
}