Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scheduler: use the store qps stats in the hot-write-leader-balance #3948

Merged
merged 1 commit into from
Aug 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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