Skip to content

perf: client QPS/Burst, orphan-scan verdicts, persistence ceiling on record - #4

Merged
CMGS merged 8 commits into
masterfrom
perf/issues-1-2-3
Jul 27, 2026
Merged

perf: client QPS/Burst, orphan-scan verdicts, persistence ceiling on record#4
CMGS merged 8 commits into
masterfrom
perf/issues-1-2-3

Conversation

@CMGS

@CMGS CMGS commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Closes #1, closes #3; benchmarks #2 and leaves it deferred per its own assessment.

All numbers: Linux container (golang:1.26) on a bare-metal bench host (AMD Ryzen 7 9700X, 16 threads), commit 6b9f74b, A/B via the benchmarks added in this branch.

#1 — client-go QPS/Burst

kubeConfig() left every client on client-go's QPS=5/Burst=10 fallback. New --kube-api-qps (default 200) / --kube-api-burst (default 400) flags apply to the shared rest.Config before any client is built.

BenchmarkClientThrottle steady-state per request
default (QPS=5) 200.0 ms
tuned (QPS=200) 4.8 ms

Each arm converges on its rate limiter's budget, as expected. A 2000-pod status-push burst queues ~400 s of client-side throttling before, ~10 s after.

#3 — OrphanScan false positives

A row whose claim_ref this provider does not hold is an apiserver-direct claim (a supported path), not an orphan candidate; it is now excluded from the orphan verdict. Remaining verdicts log on first sight instead of every cycle, so genuine orphans stay visible instead of drowning in repeat noise. Audit-only semantics (never release; failed list skips the cycle) unchanged.

A/B: before, every unclaimed row logged every 60 s cycle forever (O(direct claims) lines/min by construction); after, one line per verdict transition. TestOrphanScanExternalClaimsAndLogDedup pins 3 log lines across 3 cycles for one external + one orphan + one stale row (stale-claim verdicts joined the dedup in review).

#2 — persistence ceiling (measured, deferred)

BenchmarkCommitClaim puts a number on the scaling limit: with a full 2000-claim table, one commit costs 1.43 ms (1.9 MB, 12k allocs) — a ~700 claims/s ceiling on this hardware, consistent with the issue's 250–500/s estimate on slower disks. The coalescing redesign stays deferred per the issue's own assessment (it changes the tentative/commit write-ordering semantics and deserves its own round); the benchmark is now in-tree to gate that future change.

Gates

  • make lint (darwin+linux): 0 issues; asl ./... both GOOS: clean
  • go test -race -count=1 ./...: pass

CMGS added 8 commits July 27, 2026 17:19
client-go's QPS=5/Burst=10 fallback queued ~400s of client-side
throttling when the advertised 2000 pods push status at once, and
serialized delete-authorization reads during eviction storms.

Fixes #1
…s once

A row with a claim_ref this provider does not hold is an externally
claimed sandbox, not an orphan candidate; the L3 aggregated apiserver
claims directly against sandboxd by design. Remaining verdicts log on
first sight instead of every cycle, so genuine orphans stay visible.
Audit-only semantics unchanged.

Fixes #3
Puts a number on the #2 scaling limit: one commit serializes the whole
table under saveMu. Measured ~2.2ms/commit locally (~450 claims/s
ceiling), matching the issue's estimate; the redesign stays deferred
per the issue's own assessment.

Refs #2
The #3 dedup covered only the unclaimed-row verdicts; a stale claim
re-logged every cycle, reproducing the noise the fix removed. All three
verdicts now share one record-and-log-on-transition site.
Three identical NewTicker/select loops collapse into runTicker; the
zero-ClaimedAt fallback in runningStatus guarded a state no claim path
can produce (all three write paths stamp it, pinned by
TestEveryClaimPathStampsClaimedAt).
@CMGS
CMGS merged commit c4312f9 into master Jul 27, 2026
2 checks passed
@CMGS
CMGS deleted the perf/issues-1-2-3 branch July 27, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant