Skip to content

Commit

Permalink
scheduler: use the store qps stats in the hot-write-leader-balance (#…
Browse files Browse the repository at this point in the history
…3948)

Signed-off-by: HunDunDM <[email protected]>
  • Loading branch information
HunDunDM authored Aug 3, 2021
1 parent c06414f commit e23a9e5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions server/schedulers/hot_region.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,12 @@ func summaryStoresLoad(
hotPeers = append(hotPeers, peer.Clone())
}
// Use sum of hot peers to estimate leader-only byte rate.
// For write requests, Write{Bytes, Keys} is applied to all Peers at the same time, while the Leader and Follower are under different loads (usually the Leader consumes more CPU).
// But none of the current dimension reflect this difference, so we create a new dimension to reflect it.
// For write requests, Write{Bytes, Keys} is applied to all Peers at the same time,
// while the Leader and Follower are under different loads (usually the Leader consumes more CPU).
// Write{QPS} does not require such processing.
if kind == core.LeaderKind && rwTy == write {
loads = peerLoadSum
loads[statistics.ByteDim] = peerLoadSum[statistics.ByteDim]
loads[statistics.KeyDim] = peerLoadSum[statistics.KeyDim]
}

// Metric for debug.
Expand Down

0 comments on commit e23a9e5

Please sign in to comment.