mirror of https://github.com/milvus-io/milvus.git
enhance: Add growing row count weight (#30271)
Signed-off-by: sunby <sunbingyi1992@gmail.com>pull/30336/head
parent
467379d693
commit
406bf14e84
|
@ -261,6 +261,7 @@ queryCoord:
|
|||
heartbeatAvailableInterval: 10000 # 10s, Only QueryNodes which fetched heartbeats within the duration are available
|
||||
loadTimeoutSeconds: 600
|
||||
checkHandoffInterval: 5000
|
||||
growingRowCountWeight: 4.0
|
||||
# can specify ip for example
|
||||
# ip: 127.0.0.1
|
||||
ip: # if not specify address, will use the first unicastable address as local ip
|
||||
|
|
|
@ -149,7 +149,7 @@ func (b *ScoreBasedBalancer) calculateScore(collectionID, nodeID int64) int {
|
|||
// calculate global growing segment row count
|
||||
views := b.dist.GetLeaderView(nodeID)
|
||||
for _, view := range views {
|
||||
rowCount += int(view.NumOfGrowingRows)
|
||||
rowCount += int(float64(view.NumOfGrowingRows) * params.Params.QueryCoordCfg.GrowingRowCountWeight.GetAsFloat())
|
||||
}
|
||||
|
||||
collectionRowCount := 0
|
||||
|
@ -162,7 +162,7 @@ func (b *ScoreBasedBalancer) calculateScore(collectionID, nodeID int64) int {
|
|||
// calculate collection growing segment row count
|
||||
collectionViews := b.dist.LeaderViewManager.GetByCollectionAndNode(collectionID, nodeID)
|
||||
for _, view := range collectionViews {
|
||||
collectionRowCount += int(view.NumOfGrowingRows)
|
||||
collectionRowCount += int(float64(view.NumOfGrowingRows) * params.Params.QueryCoordCfg.GrowingRowCountWeight.GetAsFloat())
|
||||
}
|
||||
return collectionRowCount + int(float64(rowCount)*
|
||||
params.Params.QueryCoordCfg.GlobalRowCountFactor.GetAsFloat())
|
||||
|
|
|
@ -1355,6 +1355,7 @@ type queryCoordConfig struct {
|
|||
OverloadedMemoryThresholdPercentage ParamItem `refreshable:"true"`
|
||||
BalanceIntervalSeconds ParamItem `refreshable:"true"`
|
||||
MemoryUsageMaxDifferencePercentage ParamItem `refreshable:"true"`
|
||||
GrowingRowCountWeight ParamItem `refreshable:"true"`
|
||||
|
||||
SegmentCheckInterval ParamItem `refreshable:"true"`
|
||||
ChannelCheckInterval ParamItem `refreshable:"true"`
|
||||
|
@ -1512,6 +1513,16 @@ func (p *queryCoordConfig) init(base *BaseTable) {
|
|||
}
|
||||
p.BalanceIntervalSeconds.Init(base.mgr)
|
||||
|
||||
p.GrowingRowCountWeight = ParamItem{
|
||||
Key: "queryCoord.growingRowCountWeight",
|
||||
Version: "2.3.5",
|
||||
DefaultValue: "4.0",
|
||||
PanicIfEmpty: true,
|
||||
Doc: "the memory weight of growing segment row count",
|
||||
Export: true,
|
||||
}
|
||||
p.GrowingRowCountWeight.Init(base.mgr)
|
||||
|
||||
p.MemoryUsageMaxDifferencePercentage = ParamItem{
|
||||
Key: "queryCoord.memoryUsageMaxDifferencePercentage",
|
||||
Version: "2.0.0",
|
||||
|
|
Loading…
Reference in New Issue