fix: Reduce task slot for standalone to 1/4 of normal datanode (#42808)

issue: #42129

---------

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
This commit is contained in:
cai.zhang 2025-06-20 16:38:46 +08:00 committed by GitHub
parent e15926b40c
commit 8f8ffe9989
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 2 deletions

View File

@ -98,7 +98,7 @@ func CalculateNodeSlots() int64 {
totalSlot := max(slot, 1) * paramtable.Get().DataNodeCfg.WorkerSlotUnit.GetAsInt64() * paramtable.Get().DataNodeCfg.BuildParallel.GetAsInt64()
if paramtable.GetRole() == typeutil.StandaloneRole {
totalSlot = max(totalSlot/2, 1)
totalSlot = max(int64(float64(totalSlot)*paramtable.Get().DataNodeCfg.StandaloneSlotRatio.GetAsFloat()), 1)
}
return totalSlot
}

View File

@ -5192,6 +5192,7 @@ type dataNodeConfig struct {
BuildParallel ParamItem `refreshable:"false"`
WorkerSlotUnit ParamItem `refreshable:"true"`
StandaloneSlotRatio ParamItem `refreshable:"false"`
}
func (p *dataNodeConfig) init(base *BaseTable) {
@ -5618,6 +5619,14 @@ if this parameter <= 0, will set it as 10`,
Doc: "Indicates how many slots each worker occupies per 2c8g",
}
p.WorkerSlotUnit.Init(base.mgr)
p.StandaloneSlotRatio = ParamItem{
Key: "dataNode.standaloneSlotFactor",
Version: "2.5.14",
DefaultValue: "0.25",
Doc: "Offline task slot ratio in standalone mode",
}
p.StandaloneSlotRatio.Init(base.mgr)
}
type streamingConfig struct {

View File

@ -625,6 +625,8 @@ func TestComponentParam(t *testing.T) {
assert.Equal(t, int64(2), Params.ClusteringCompactionWorkerPoolSize.GetAsInt64())
assert.Equal(t, 2, Params.BloomFilterApplyParallelFactor.GetAsInt())
assert.Equal(t, 16, Params.WorkerSlotUnit.GetAsInt())
assert.Equal(t, 0.25, Params.StandaloneSlotRatio.GetAsFloat())
})
t.Run("test streamingConfig", func(t *testing.T) {