enhance: Limit index pool size of standalone server (#30170)

issue: #29926

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
pull/30389/head
cai.zhang 2024-01-30 16:47:03 +08:00 committed by GitHub
parent f619d792c0
commit 47af347d0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 26 additions and 8 deletions

View File

@ -545,6 +545,7 @@ common:
highPriority: 10 # This parameter specify how many times the number of threads is the number of cores in high priority thread pool
middlePriority: 5 # This parameter specify how many times the number of threads is the number of cores in middle priority thread pool
lowPriority: 1 # This parameter specify how many times the number of threads is the number of cores in low priority thread pool
buildIndexThreadPoolRatio: 0.75
DiskIndex:
MaxDegree: 56
SearchListSize: 100

View File

@ -179,6 +179,13 @@ func (i *IndexNode) initSegcore() {
C.InitCpuNum(cCPUNum)
cKnowhereThreadPoolSize := C.uint32_t(hardware.GetCPUNum() * paramtable.DefaultKnowhereThreadPoolNumRatioInBuild)
if paramtable.GetRole() == typeutil.StandaloneRole {
threadPoolSize := int(float64(hardware.GetCPUNum()) * Params.CommonCfg.BuildIndexThreadPoolRatio.GetAsFloat())
if threadPoolSize < 1 {
threadPoolSize = 1
}
cKnowhereThreadPoolSize = C.uint32_t(threadPoolSize)
}
C.SegcoreSetKnowhereBuildThreadPoolNum(cKnowhereThreadPoolSize)
localDataRootPath := filepath.Join(Params.LocalStorageCfg.Path.GetValue(), typeutil.IndexNodeRole)

View File

@ -44,14 +44,15 @@ const (
DefaultMinioIAMEndpoint = ""
DefaultEtcdEndpoints = "localhost:2379"
DefaultLogFormat = "text"
DefaultLogLevelForBase = "debug"
DefaultRootPath = ""
DefaultMinioLogLevel = "fatal"
DefaultKnowhereThreadPoolNumRatioInBuild = 1
DefaultMinioRegion = ""
DefaultMinioUseVirtualHost = "false"
DefaultMinioRequestTimeout = "10000"
DefaultLogFormat = "text"
DefaultLogLevelForBase = "debug"
DefaultRootPath = ""
DefaultMinioLogLevel = "fatal"
DefaultKnowhereThreadPoolNumRatioInBuild = 1
DefaultKnowhereThreadPoolNumRatioInBuildOfStandalone = 0.75
DefaultMinioRegion = ""
DefaultMinioUseVirtualHost = "false"
DefaultMinioRequestTimeout = "10000"
)
// Const of Global Config List

View File

@ -191,6 +191,7 @@ type commonConfig struct {
MiddlePriorityThreadCoreCoefficient ParamItem `refreshable:"false"`
LowPriorityThreadCoreCoefficient ParamItem `refreshable:"false"`
EnableNodeFilteringOnPartitionKey ParamItem `refreshable:"false"`
BuildIndexThreadPoolRatio ParamItem `refreshable:"false"`
MaxDegree ParamItem `refreshable:"true"`
SearchListSize ParamItem `refreshable:"true"`
PQCodeBudgetGBRatio ParamItem `refreshable:"true"`
@ -544,6 +545,14 @@ This configuration is only used by querynode and indexnode, it selects CPU instr
}
p.LowPriorityThreadCoreCoefficient.Init(base.mgr)
p.BuildIndexThreadPoolRatio = ParamItem{
Key: "common.buildIndexThreadPoolRatio",
Version: "2.4.0",
DefaultValue: strconv.FormatFloat(DefaultKnowhereThreadPoolNumRatioInBuildOfStandalone, 'f', 2, 64),
Export: true,
}
p.BuildIndexThreadPoolRatio.Init(base.mgr)
p.AuthorizationEnabled = ParamItem{
Key: "common.security.authorizationEnabled",
Version: "2.0.0",