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

kvserver: add minimum cpu lb split threshold #98250

Merged
merged 1 commit into from
Mar 9, 2023
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
14 changes: 14 additions & 0 deletions pkg/kv/kvserver/replica_split_load.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ var SplitByLoadCPUThreshold = settings.RegisterDurationSetting(
"kv.range_split.load_cpu_threshold",
"the CPU use per second over which, the range becomes a candidate for load based splitting",
500*time.Millisecond,
func(threshold time.Duration) error {
// We enforce a minimum because of recursive splitting that may occur if
// the threshold is set too low. There is a fixed CPU overhead for a
// replica. At the moment no split key will be produced unless there are
// more than 100 samples (batch requests) to that replica, however the
// memory overhead of tracking split keys in split/weighted_finder.go is
// noticeable and a finder is created after exceeding this threshold.
if threshold < 10*time.Millisecond {
return errors.Errorf(
"Cannot set `kv.range_split.load_cpu_threshold` less than 10ms",
)
}
return nil
},
).WithPublic()

func (obj LBRebalancingObjective) ToSplitObjective() split.SplitObjective {
Expand Down