set knowhere thread pool size in index node (#25804)

Signed-off-by: cqy123456 <qianya.cheng@zilliz.com>
pull/25850/head
cqy123456 2023-07-21 06:50:59 -04:00 committed by GitHub
parent eecf229b59
commit 0f3350ded4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -17,11 +17,12 @@
package indexnode package indexnode
/* /*
#cgo pkg-config: milvus_common milvus_indexbuilder #cgo pkg-config: milvus_common milvus_indexbuilder milvus_segcore
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
#include "common/init_c.h" #include "common/init_c.h"
#include "segcore/segcore_init_c.h"
#include "indexbuilder/init_c.h" #include "indexbuilder/init_c.h"
*/ */
import "C" import "C"
@ -162,6 +163,9 @@ func (i *IndexNode) initSegcore() {
cCPUNum := C.int(hardware.GetCPUNum()) cCPUNum := C.int(hardware.GetCPUNum())
C.InitCpuNum(cCPUNum) C.InitCpuNum(cCPUNum)
cKnowhereThreadPoolSize := C.uint32_t(hardware.GetCPUNum() * paramtable.DefaultKnowhereThreadPoolNumRatioInBuild)
C.SegcoreSetKnowhereThreadPoolNum(cKnowhereThreadPoolSize)
localDataRootPath := filepath.Join(Params.LocalStorageCfg.Path.GetValue(), typeutil.IndexNodeRole) localDataRootPath := filepath.Join(Params.LocalStorageCfg.Path.GetValue(), typeutil.IndexNodeRole)
initcore.InitLocalChunkManager(localDataRootPath) initcore.InitLocalChunkManager(localDataRootPath)
} }

View File

@ -44,9 +44,10 @@ const (
DefaultMinioIAMEndpoint = "" DefaultMinioIAMEndpoint = ""
DefaultEtcdEndpoints = "localhost:2379" DefaultEtcdEndpoints = "localhost:2379"
DefaultLogFormat = "text" DefaultLogFormat = "text"
DefaultLogLevelForBase = "debug" DefaultLogLevelForBase = "debug"
DefaultRootPath = "" DefaultRootPath = ""
DefaultKnowhereThreadPoolNumRatioInBuild = 1
) )
// Const of Global Config List // Const of Global Config List