From 0f3350ded47ab25ee558b189773740a0c8199864 Mon Sep 17 00:00:00 2001 From: cqy123456 <39671710+cqy123456@users.noreply.github.com> Date: Fri, 21 Jul 2023 06:50:59 -0400 Subject: [PATCH] set knowhere thread pool size in index node (#25804) Signed-off-by: cqy123456 --- internal/indexnode/indexnode.go | 6 +++++- pkg/util/paramtable/base_table.go | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/internal/indexnode/indexnode.go b/internal/indexnode/indexnode.go index 961ac4d881..911aa6c979 100644 --- a/internal/indexnode/indexnode.go +++ b/internal/indexnode/indexnode.go @@ -17,11 +17,12 @@ package indexnode /* -#cgo pkg-config: milvus_common milvus_indexbuilder +#cgo pkg-config: milvus_common milvus_indexbuilder milvus_segcore #include #include #include "common/init_c.h" +#include "segcore/segcore_init_c.h" #include "indexbuilder/init_c.h" */ import "C" @@ -162,6 +163,9 @@ func (i *IndexNode) initSegcore() { cCPUNum := C.int(hardware.GetCPUNum()) C.InitCpuNum(cCPUNum) + cKnowhereThreadPoolSize := C.uint32_t(hardware.GetCPUNum() * paramtable.DefaultKnowhereThreadPoolNumRatioInBuild) + C.SegcoreSetKnowhereThreadPoolNum(cKnowhereThreadPoolSize) + localDataRootPath := filepath.Join(Params.LocalStorageCfg.Path.GetValue(), typeutil.IndexNodeRole) initcore.InitLocalChunkManager(localDataRootPath) } diff --git a/pkg/util/paramtable/base_table.go b/pkg/util/paramtable/base_table.go index 031ed23e7f..7ab4dadb13 100644 --- a/pkg/util/paramtable/base_table.go +++ b/pkg/util/paramtable/base_table.go @@ -44,9 +44,10 @@ const ( DefaultMinioIAMEndpoint = "" DefaultEtcdEndpoints = "localhost:2379" - DefaultLogFormat = "text" - DefaultLogLevelForBase = "debug" - DefaultRootPath = "" + DefaultLogFormat = "text" + DefaultLogLevelForBase = "debug" + DefaultRootPath = "" + DefaultKnowhereThreadPoolNumRatioInBuild = 1 ) // Const of Global Config List