feat: support set up knowhere-build-pool-size on querynode(#29650) (#30922)

related: #29650

Signed-off-by: MrPresent-Han <chun.han@zilliz.com>
pull/30946/head
MrPresent-Han 2024-02-29 18:15:00 +08:00 committed by GitHub
parent d930666b3e
commit 17a2fd048e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 6 deletions

View File

@ -303,6 +303,7 @@ queryNode:
nlist: 128 # segment index nlist
nprobe: 16 # nprobe to search segment, based on your accuracy requirement, must smaller than nlist
memExpansionRate: 1.15 # the ratio of building interim index memory usage to raw data
buildParallelRate: 0.5 # the ratio of building interim index parallel matched with cpu num
loadMemoryUsageFactor: 1 # The multiply factor of calculating the memory usage while loading segments
enableDisk: false # enable querynode load disk index, and search on disk index
maxDiskUsagePercentage: 95

View File

@ -215,6 +215,10 @@ func (node *QueryNode) InitSegcore() error {
cCPUNum := C.int(hardware.GetCPUNum())
C.InitCpuNum(cCPUNum)
knowhereBuildPoolSize := uint32(float32(paramtable.Get().QueryNodeCfg.InterimIndexBuildParallelRate.GetAsFloat()) * float32(hardware.GetCPUNum()))
cKnowhereBuildPoolSize := C.uint32_t(knowhereBuildPoolSize)
C.SegcoreSetKnowhereBuildThreadPoolNum(cKnowhereBuildPoolSize)
cExprBatchSize := C.int64_t(paramtable.Get().QueryNodeCfg.ExprEvalBatchSize.GetAsInt64())
C.InitDefaultExprEvalBatchSize(cExprBatchSize)

View File

@ -1917,12 +1917,13 @@ type queryNodeConfig struct {
StatsPublishInterval ParamItem `refreshable:"true"`
// segcore
KnowhereThreadPoolSize ParamItem `refreshable:"false"`
ChunkRows ParamItem `refreshable:"false"`
EnableTempSegmentIndex ParamItem `refreshable:"false"`
InterimIndexNlist ParamItem `refreshable:"false"`
InterimIndexNProbe ParamItem `refreshable:"false"`
InterimIndexMemExpandRate ParamItem `refreshable:"false"`
KnowhereThreadPoolSize ParamItem `refreshable:"false"`
ChunkRows ParamItem `refreshable:"false"`
EnableTempSegmentIndex ParamItem `refreshable:"false"`
InterimIndexNlist ParamItem `refreshable:"false"`
InterimIndexNProbe ParamItem `refreshable:"false"`
InterimIndexMemExpandRate ParamItem `refreshable:"false"`
InterimIndexBuildParallelRate ParamItem `refreshable:"true"`
// memory limit
LoadMemoryUsageFactor ParamItem `refreshable:"true"`
@ -2076,6 +2077,15 @@ func (p *queryNodeConfig) init(base *BaseTable) {
}
p.InterimIndexMemExpandRate.Init(base.mgr)
p.InterimIndexBuildParallelRate = ParamItem{
Key: "queryNode.segcore.interimIndex.buildParallelRate",
Version: "2.0.0",
DefaultValue: "0.5",
Doc: "the ratio of building interim index parallel matched with cpu num",
Export: true,
}
p.InterimIndexBuildParallelRate.Init(base.mgr)
p.InterimIndexNProbe = ParamItem{
Key: "queryNode.segcore.interimIndex.nprobe",
Version: "2.0.0",