Skip to content

Commit

Permalink
goschedstats: reduce underloadedRunnablePerProcThreshold
Browse files Browse the repository at this point in the history
By reducing this threshold, we more often sample the stats at 1ms
intervals, which is desirable for admission control slot adjustment.

Fixes #111125

Epic: none

Release note: None
  • Loading branch information
sumeerbhola committed Sep 29, 2023
1 parent af05d81 commit 32adda2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pkg/util/goschedstats/runnable.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,16 @@ var _ = numRunnableGoroutines
const samplePeriodShort = time.Millisecond
const samplePeriodLong = 250 * time.Millisecond

// The system is underloaded if the number of runnable goroutines per proc
// is below this threshold.
const underloadedRunnablePerProcThreshold = 1 * toFixedPoint
// The system is underloaded if the number of runnable goroutines per proc is
// below this threshold. We have observed that steady workloads (like kv0),
// can have 50% cpu utilization and < 0.2 runnable goroutines per proc. We
// want to err on the side of a lower threshold since the samplePeriodShort
// regime allows admission control to react faster to fluctuations in runnable
// goroutines -- real world workloads sometimes have very spiky CPU
// utilization (see the graphs in
// https://github.com/cockroachdb/cockroach/issues/111125). So we set this to
// 0.1 runnable goroutine per proc.
const underloadedRunnablePerProcThreshold = 1 * toFixedPoint / 10

// We "report" the average value every reportingPeriod.
// Note: if this is changed from 1s, CumulativeNormalizedRunnableGoroutines()
Expand Down

0 comments on commit 32adda2

Please sign in to comment.