Skip to content

Conversation

@joshimhoff
Copy link
Collaborator

@joshimhoff joshimhoff commented Dec 5, 2025

admission: compute upper bound from target util

This commit updates the upper bound computation done in cpuTimeTokenLinearModel to use the smallest target CPU utilization across all the token buckets in
cpuTimeTokenGranter. Previously, this computation used a hard-coded target utilization, which was a bug.

Release note: None.

Fixes: #158600

This addresses the following comment from an earlier PR: https://reviewable.io/reviews/cockroachdb/cockroach/157029#-OfUmUtz2cStbN9M9tuf

This commit updates the upper bound computation done in
cpuTimeTokenLinearModel to use the smallest target CPU
utilization across all the token buckets in
cpuTimeTokenGranter. Previously, this computation used
a hard-coded target utilization, which was a bug.

Release note: None.

<what was there before: Previously, ...>
<why it needed to change: This was inadequate because ...>
<what you did about it: To address this, this patch ...>
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@joshimhoff joshimhoff marked this pull request as ready for review December 5, 2025 20:06
@joshimhoff joshimhoff requested a review from a team as a code owner December 5, 2025 20:06
@joshimhoff joshimhoff requested review from sumeerbhola and tbg December 5, 2025 20:06
Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@sumeerbhola reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @joshimhoff and @tbg)


pkg/util/admission/cpu_time_token_filler.go line 65 at r1 (raw file):

const (
	// See the extensive comments in fit near isLowCPUUtil for info regarding

nit: ... extensive comments near isLowCPUUtil declaration for info ...

(I couldn't make sense of "in fit")


pkg/util/admission/cpu_time_token_filler.go line 71 at r1 (raw file):

	// settings can be set to. < 50% CPU utilization is not a cost-effective choice,
	// as it leads lots of hardware resources unused, even in case of short spikes.
	// So we do not support < 50% CPU utilization.

nit: The "So we do ..." is not adding any new information. Consider deleting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

admission: make low CPU lower bound logic work with a variety of target CPU utilizations

3 participants