Conversation
Codecov Report
@@ Coverage Diff @@
## master #14 +/- ##
==========================================
- Coverage 93.58% 91.57% -2.01%
==========================================
Files 7 7
Lines 187 190 +3
==========================================
- Hits 175 174 -1
- Misses 10 14 +4
Partials 2 2
Continue to review full report at Codecov.
|
arkajit
left a comment
There was a problem hiding this comment.
Sounds reasonable to have a separate reservation for resources used outside the go-runtime.
Left a couple small comments about whether we want to respect this reservation fully or whether the boundary between reserved and non-reserved quota is permeable. The answer depends on the previous discussion about whether we want to prevent throttling or under-utilization.
From the system perspective, it seems clear that we'd prefer throttling to under-utilization, but at the moment the throttling penalty is quite large (100ms) which can be severe for latency-critical applications. Ideally we'd allow applications to make this tradeoff themselves.
| quota -= cfg.Reserved | ||
| } | ||
|
|
||
| maxProcs := int(math.Ceil(quota)) |
There was a problem hiding this comment.
Do we want Floor here after all? If we use Ceil, we will not be respecting the full reservation for the Reserved quota. Can Reserved ever be fractional?
There was a problem hiding this comment.
Correct, we do want floor, this PR was just written orthogonally to #13.
| // outside of the Go runtime; e.g. by a cgo extension, or another process | ||
| // within the container. | ||
| // | ||
| // GOMAXPROCS will be set to the remaining (rounded down) quota, clamped to the |
There was a problem hiding this comment.
Is "rounded down" still the intention? This part of the comment contradicts the use of Ceil in CPUQuotaToGOMAXPROCS (commented there).
There was a problem hiding this comment.
Yes it is, this doc comment is out of line with the code reality above, good catch.
|
Joshua T Corbin seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Okay, after offline discussion with @prashantv and @akshayjshah, here's an addendum to #13:
Reserved(q float64)option that can be used to not allocate all of the CPU quota toGOMAXPROCSfunc(func(quota float64, config CPUQuotaConfig) (int, CPUQuotaStatus)) Option)Questions I have for reviewers at the outset:
Reserved?