mirror of https://github.com/milvus-io/milvus.git
Make cgo pool size larger than worker pool size (#25318)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>pull/25344/head
parent
c2a2ece551
commit
efdd71c640
|
@ -225,6 +225,7 @@ queryNode:
|
||||||
stats:
|
stats:
|
||||||
publishInterval: 1000 # Interval for querynode to report node information (milliseconds)
|
publishInterval: 1000 # Interval for querynode to report node information (milliseconds)
|
||||||
segcore:
|
segcore:
|
||||||
|
cgoPoolSizeRatio: 2.0 # cgo pool size ratio to max read concurrency
|
||||||
knowhereThreadPoolNumRatio: 4
|
knowhereThreadPoolNumRatio: 4
|
||||||
# Use more threads to make better use of SSD throughput in disk index.
|
# Use more threads to make better use of SSD throughput in disk index.
|
||||||
# This parameter is only useful when enable-disk = true.
|
# This parameter is only useful when enable-disk = true.
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
package segments
|
package segments
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"math"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
@ -33,8 +34,9 @@ var (
|
||||||
// InitPool initialize
|
// InitPool initialize
|
||||||
func InitPool() {
|
func InitPool() {
|
||||||
initOnce.Do(func() {
|
initOnce.Do(func() {
|
||||||
|
pt := paramtable.Get()
|
||||||
pool := conc.NewPool[any](
|
pool := conc.NewPool[any](
|
||||||
paramtable.Get().QueryNodeCfg.MaxReadConcurrency.GetAsInt(),
|
int(math.Ceil(pt.QueryNodeCfg.MaxReadConcurrency.GetAsFloat()*pt.QueryNodeCfg.CGOPoolSizeRatio.GetAsFloat())),
|
||||||
conc.WithPreAlloc(true),
|
conc.WithPreAlloc(true),
|
||||||
conc.WithDisablePurge(true),
|
conc.WithDisablePurge(true),
|
||||||
)
|
)
|
||||||
|
|
|
@ -1485,6 +1485,9 @@ type queryNodeConfig struct {
|
||||||
SchedulePolicyTaskQueueExpire ParamItem `refreshable:"true"`
|
SchedulePolicyTaskQueueExpire ParamItem `refreshable:"true"`
|
||||||
SchedulePolicyEnableCrossUserGrouping ParamItem `refreshable:"true"`
|
SchedulePolicyEnableCrossUserGrouping ParamItem `refreshable:"true"`
|
||||||
SchedulePolicyMaxPendingTaskPerUser ParamItem `refreshable:"true"`
|
SchedulePolicyMaxPendingTaskPerUser ParamItem `refreshable:"true"`
|
||||||
|
|
||||||
|
// CGOPoolSize ratio to MaxReadConcurrency
|
||||||
|
CGOPoolSizeRatio ParamItem `refreshable:"false"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *queryNodeConfig) init(base *BaseTable) {
|
func (p *queryNodeConfig) init(base *BaseTable) {
|
||||||
|
@ -1839,6 +1842,14 @@ Max read concurrency must greater than or equal to 1, and less than or equal to
|
||||||
Doc: "Max pending task per user in scheduler",
|
Doc: "Max pending task per user in scheduler",
|
||||||
}
|
}
|
||||||
p.SchedulePolicyMaxPendingTaskPerUser.Init(base.mgr)
|
p.SchedulePolicyMaxPendingTaskPerUser.Init(base.mgr)
|
||||||
|
|
||||||
|
p.CGOPoolSizeRatio = ParamItem{
|
||||||
|
Key: "queryNode.segcore.cgoPoolSizeRatio",
|
||||||
|
Version: "2.3.0",
|
||||||
|
DefaultValue: "2.0",
|
||||||
|
Doc: "cgo pool size ratio to max read concurrency",
|
||||||
|
}
|
||||||
|
p.CGOPoolSizeRatio.Init(base.mgr)
|
||||||
}
|
}
|
||||||
|
|
||||||
// /////////////////////////////////////////////////////////////////////////////
|
// /////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue