fix(plan): hold a starved pool instead of growing it - #15
Merged
Merged
Conversation
noteStarved has always diagnosed the case correctly - 'the queue is the CPU's, not the ceiling's' when a pool queues while the host CPU is >=95% busy - but the plan still treated the ceiling-hit as demand and grew the pool. On a 2-CPU container under saturated CPU-bound load that meant 8 -> 21 workers and -16% throughput (php-baseimages benchmark; the worker sweep is monotonic downward on pure CPU). plan.Input gains HostBusy/HostBusyKnown (wired from serve's existing hostBusyRatio). While starved, a pool's ceiling-hit is ignored AND its CPU ceiling is pinned to its current size so headroom-driven demand cannot grow it either; Result.StarvedHeld reports the held pools. Unknown busy ratio preserves the old behavior exactly. The issue's other symptom (cpu_readings staying 0) is the 50ms minCPURequestMicros floor and stays open on #14.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 2 of #14.
noteStarvedhas always diagnosed the case correctly — "the queue is the CPU's, not the ceiling's" — while the plan grew the pool on the same round's ceiling-hit signal. Measured on a 2-CPU container under saturated CPU-bound load (php-baseimages benchmark): growth 8 → 21 workers, −16% throughput (worker sweep monotonic downward on pure CPU: 2w=403 … 21w=310 rps).Change:
plan.InputgainsHostBusy/HostBusyKnown(wired from serve's existinghostBusyRatio). While a pool queues and the host is ≥95% busy, its ceiling-hit is ignored and its CPU ceiling is pinned to its current size so headroom demand cannot grow it either.Result.StarvedHeldreports held pools. Unknown busy ratio ⇒ old behavior exactly; growth resumes when the CPU has room.Not addressed:
cpu_readings=0for sub-50ms requests (minCPURequestMicros) — needs its own design discussion, stays open on #14.Tests:
TestBuild_StarvedPoolIsHeldNotGrown(held / resume / unknown); full suite, vet, gofmt, sbom-check, license-check green.