forked from TrueCloudLab/frostfs-node
[#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:
parent
5b1975d52a
commit
2126235f0e
6 changed files with 35 additions and 3 deletions
|
@ -14,9 +14,13 @@ import (
|
|||
|
||||
func TestEngineSection(t *testing.T) {
|
||||
t.Run("defaults", func(t *testing.T) {
|
||||
empty := configtest.EmptyConfig()
|
||||
|
||||
require.Panics(t, func() {
|
||||
engineconfig.IterateShards(configtest.EmptyConfig(), nil)
|
||||
engineconfig.IterateShards(empty, nil)
|
||||
})
|
||||
|
||||
require.EqualValues(t, engineconfig.ShardPoolSizeDefault, engineconfig.ShardPoolSize(empty))
|
||||
})
|
||||
|
||||
const path = "../../../../config/example/node"
|
||||
|
@ -24,6 +28,8 @@ func TestEngineSection(t *testing.T) {
|
|||
var fileConfigTest = func(c *config.Config) {
|
||||
num := 0
|
||||
|
||||
require.EqualValues(t, 15, engineconfig.ShardPoolSize(c))
|
||||
|
||||
engineconfig.IterateShards(c, func(sc *shardconfig.Config) {
|
||||
defer func() {
|
||||
num++
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue