mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 01:58:34 +08:00
Set channel work pool size in datanode (#27728)
Signed-off-by: lixinguo <xinguo.li@zilliz.com> Co-authored-by: lixinguo <xinguo.li@zilliz.com>
This commit is contained in:
parent
d3d79c0ff4
commit
4b0ec156b3
@ -418,6 +418,11 @@ dataNode:
|
|||||||
watermarkCluster: 0.5 # memory watermark for cluster, upon reaching this watermark, segments will be synced.
|
watermarkCluster: 0.5 # memory watermark for cluster, upon reaching this watermark, segments will be synced.
|
||||||
timetick:
|
timetick:
|
||||||
byRPC: true
|
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.
|
# Configures the system log output.
|
||||||
log:
|
log:
|
||||||
|
|||||||
@ -32,7 +32,11 @@ func getOrCreateIOPool() *conc.Pool[any] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func initStatsPool() {
|
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] {
|
func getOrCreateStatsPool() *conc.Pool[any] {
|
||||||
|
|||||||
@ -2391,6 +2391,9 @@ type dataNodeConfig struct {
|
|||||||
|
|
||||||
// Skip BF
|
// Skip BF
|
||||||
SkipBFStatsLoad ParamItem `refreshable:"true"`
|
SkipBFStatsLoad ParamItem `refreshable:"true"`
|
||||||
|
|
||||||
|
// channel
|
||||||
|
ChannelWorkPoolSize ParamItem `refreshable:"true"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *dataNodeConfig) init(base *BaseTable) {
|
func (p *dataNodeConfig) init(base *BaseTable) {
|
||||||
@ -2545,6 +2548,14 @@ func (p *dataNodeConfig) init(base *BaseTable) {
|
|||||||
DefaultValue: "18000",
|
DefaultValue: "18000",
|
||||||
}
|
}
|
||||||
p.BulkInsertTimeoutSeconds.Init(base.mgr)
|
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
// /////////////////////////////////////////////////////////////////////////////
|
// /////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@ -380,6 +380,10 @@ func TestComponentParam(t *testing.T) {
|
|||||||
bulkinsertTimeout := &Params.BulkInsertTimeoutSeconds
|
bulkinsertTimeout := &Params.BulkInsertTimeoutSeconds
|
||||||
t.Logf("BulkInsertTimeoutSeconds: %v", bulkinsertTimeout)
|
t.Logf("BulkInsertTimeoutSeconds: %v", bulkinsertTimeout)
|
||||||
assert.Equal(t, "18000", Params.BulkInsertTimeoutSeconds.GetValue())
|
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) {
|
t.Run("test indexNodeConfig", func(t *testing.T) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user