Set channel work pool size in datanode (#27728)

Signed-off-by: lixinguo <xinguo.li@zilliz.com>
Co-authored-by: lixinguo <xinguo.li@zilliz.com>
pull/27744/head
smellthemoon 2023-10-19 08:28:08 +08:00 committed by GitHub
parent d3d79c0ff4
commit 4b0ec156b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 1 deletions

View File

@ -418,6 +418,11 @@ dataNode:
watermarkCluster: 0.5 # memory watermark for cluster, upon reaching this watermark, segments will be synced.
timetick:
byRPC: true
channel:
# specify the size of global work pool of all channels
# if this parameter <= 0, will set it as the maximum number of CPUs that can be executing
# suggest to set it bigger on large collection numbers to avoid blocking
workPoolSize: -1
# Configures the system log output.
log:

View File

@ -32,7 +32,11 @@ func getOrCreateIOPool() *conc.Pool[any] {
}
func initStatsPool() {
statsPool = conc.NewPool[any](runtime.GOMAXPROCS(0), conc.WithPreAlloc(false), conc.WithNonBlocking(false))
poolSize := Params.DataNodeCfg.ChannelWorkPoolSize.GetAsInt()
if poolSize <= 0 {
poolSize = runtime.GOMAXPROCS(0)
}
statsPool = conc.NewPool[any](poolSize, conc.WithPreAlloc(false), conc.WithNonBlocking(false))
}
func getOrCreateStatsPool() *conc.Pool[any] {

View File

@ -2391,6 +2391,9 @@ type dataNodeConfig struct {
// Skip BF
SkipBFStatsLoad ParamItem `refreshable:"true"`
// channel
ChannelWorkPoolSize ParamItem `refreshable:"true"`
}
func (p *dataNodeConfig) init(base *BaseTable) {
@ -2545,6 +2548,14 @@ func (p *dataNodeConfig) init(base *BaseTable) {
DefaultValue: "18000",
}
p.BulkInsertTimeoutSeconds.Init(base.mgr)
p.ChannelWorkPoolSize = ParamItem{
Key: "datanode.channel.workPoolSize",
Version: "2.3.2",
PanicIfEmpty: false,
DefaultValue: "-1",
}
p.ChannelWorkPoolSize.Init(base.mgr)
}
// /////////////////////////////////////////////////////////////////////////////

View File

@ -380,6 +380,10 @@ func TestComponentParam(t *testing.T) {
bulkinsertTimeout := &Params.BulkInsertTimeoutSeconds
t.Logf("BulkInsertTimeoutSeconds: %v", bulkinsertTimeout)
assert.Equal(t, "18000", Params.BulkInsertTimeoutSeconds.GetValue())
channelWorkPoolSize := Params.ChannelWorkPoolSize.GetAsInt()
t.Logf("channelWorkPoolSize: %d", channelWorkPoolSize)
assert.Equal(t, -1, Params.ChannelWorkPoolSize.GetAsInt())
})
t.Run("test indexNodeConfig", func(t *testing.T) {