Skip to content

docs: size from the pod's CPU request, and document runtime.cpu.cores: all - #2078

Merged
bjchambers merged 3 commits into
trunkfrom
ben/12489-cpu-entitlement-docs
Aug 11, 2026
Merged

docs: size from the pod's CPU request, and document runtime.cpu.cores: all#2078
bjchambers merged 3 commits into
trunkfrom
ben/12489-cpu-entitlement-docs

Conversation

@bjchambers

Copy link
Copy Markdown
Contributor

Documents the CPU-entitlement change from spiceai/spiceai#12581 (step 6 of spiceai/spiceai#12489). Targets website/docs — trunk, i.e. Next — since the change ships in 2.2.0 and is not in any released version.

Why this is a correction, not an addition

Three pages described behaviour that spiceai/spiceai#12581 reverses. The clearest example, from runtime.cpu:

A cgroup CPU share … is deliberately never an input to sizing. … It follows that a pod setting resources.requests.cpu without a matching resources.limits.cpu is sized for the whole node.

That is now false, and it was the recommended Kubernetes configuration — so the wrong sentence was the one most readers would act on.

runtime.cpu reference

  • Detection ladder gains the declared-request rung: min(max(2 cores, request × 2), available CPUs), below the CPU quota and above the affinity mask.
  • all documented as an accepted value, with the property that distinguishes it from every other setting: it defers to a quantity named on a lower-precedence surface. That is what lets a platform set SPICE_CPU_CORES=all fleet-wide without silencing an operator's own runtime.cpu.cores: 4. It does not defer to auto.
  • New "Sizing from a CPU request" covering the bounded multiple, the 2-core floor, and why the request must be declared rather than inferred from a cgroup share (every cgroup carries one; the conversion back varies by runtime).
  • The downward-API block, with both load-bearing details called out: divisor: 1m is what makes the value millicores, and the block must be emitted only when a request is set, because resourceFieldRef otherwise reports node allocatable — the exact over-sizing this prevents.
  • The Helm chart and the Kubernetes Operator both emit it automatically, so neither needs configuring; a hand-written pod spec does, and the runtime warns when it detects that gap.
  • Startup output refreshed, and the old shortfall-warning paragraph replaced with the three warnings that exist now: request not passed through, implausibly small declared request, and share drift after an in-place resize.

Performance tuning

The Kubernetes section said a pod following its own advice is sized for the whole node. It now states the default plainly — requests.cpu: 4 on a 64-core node sizes for 8 cores, with no configuration needed — and adds a table of which knob answers which intent:

Intent Configuration
Pack many mostly-idle instances, each free to burst wide runtime.cpu.cores: all
Size for a specific number runtime.cpu.cores: 6
Hard-cap consumption per cluster policy resources.limits.cpu (accepts throttling)

The existing "avoid CPU limits" tip now points at runtime.cpu.cores as the way to bound the runtime without a CFS quota — it caps how much machine the runtime organizes itself around, not how much CPU it may consume.

Observability

spiced_cpu_budget_cores{source} gains request_burst and all_cores. spiced_cpu_request_millicores no longer claims to be "never used for sizing" — it is the declared request, and the source label is the authority on whether it won.

Verification

Every value is checked against the shipped source rather than this PR's description: CPU_REQUEST_BURST_FACTOR = 2, REQUEST_DERIVED_FLOOR_MILLICORES = 2000, SUSPECT_CORE_SHAPED_MILLICORES = 10, the six CpuSource::as_str labels, and the chart's containerName: spiceai / divisor: 1m. The startup-log examples are copied from real output, not composed.

npm run build passes, which is what validates the new #sizing-from-a-cpu-request anchor and the cross-page links into it.

Refs spiceai/spiceai#12489

…s: all`

spiceai/spiceai#12581 changed where the CPU entitlement comes from for the most
common Kubernetes shape, which made three pages wrong rather than merely
incomplete.

`runtime.cpu`: the detection ladder gains the declared-request rung, and the
claims it replaces are gone — that a cgroup share is never an input to sizing "so
a pod with requests and no limits is sized for the whole node" described the
behaviour this change reverses. Adds `all` as an accepted value, including the one
way it differs from every other setting: it defers to a quantity named on a
lower-precedence surface, which is what lets a platform set it fleet-wide without
silencing a per-pod spicepod. New subsection covers the multiple, the 2-core
floor, why the request must be *declared* rather than inferred from a share, and
the two load-bearing details of the downward-API block — the `divisor: 1m`, and
emitting it only when a request is set, since `resourceFieldRef` otherwise reports
node allocatable.

Performance tuning: the Kubernetes guidance said a pod following its own advice
(requests, no limits) is sized for the whole node. It now says what actually
happens, that this is the no-configuration default because the Helm chart and the
Kubernetes Operator both emit the passthrough, and gives a table of which knob
answers which intent — including `runtime.cpu.cores` as the way to bound the
runtime without the CFS throttling a `limits.cpu` imposes.

Observability: `spiced_cpu_budget_cores{source}` gains `request_burst` and
`all_cores`, and `spiced_cpu_request_millicores` no longer claims to be "never
used for sizing" — it is the declared request, and the `source` label is what says
whether it won.

Every constant and label is checked against the shipped source: factor 2, the
2000-millicore floor, the 10-millicore implausibility threshold, the six source
labels, and the chart's `containerName` and `divisor`.
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

✅ Pull with Spice Passed

Passing checks:

  • ✅ Title meets minimum length requirement (10 characters)
  • ✅ Has at least one of the required labels: area/blog, area/docs, area/cookbook, dependencies
  • ✅ No banned labels detected
  • ✅ Has at least one assignee: bjchambers

@github-actions

Copy link
Copy Markdown
Contributor

🚀 deployed to https://9d2902cd.spiceai-org-website.pages.dev

@bjchambers bjchambers self-assigned this Aug 11, 2026
Comment thread website/docs/features/observability/index.md
Comment thread website/docs/features/observability/index.md Outdated
Comment thread website/docs/reference/spicepod/runtime.md Outdated
Comment thread website/docs/reference/spicepod/runtime.md
Four review points.

The `source` label values were listed without meaning, so a reader seeing
`request_burst` had nothing to go on. A new section in Observability gives each of
the six a row: what it means and, for `request_burst`, the formula it applied.

`spiced_cpu_request_millicores` did not say how the request reaches the runtime.
It cannot read `resources.requests.cpu` itself, so the same section carries the
downward-API block and states that the Helm chart and the Kubernetes Operator
both emit it by default — a hand-written pod spec reports `affinity` instead.

The `auto` row of the accepted-values table said only "detect the entitlement".
It now gives the formula and, more usefully, why the multiple exists: it exceeds
the request deliberately so a burstable pod can still burst above its scheduling
floor.

The Kubernetes deployment page said nothing about CPU at all. It gains a sizing
section — the three pod shapes and what each resolves to, that the chart and
operator wire the request automatically, and `runtime.cpu.cores: all` for bursting
across the whole machine, which is what the Spice Cloud Platform sets on hosted
instances. It closes on preferring `runtime.cpu.cores` to a `limits.cpu` CFS quota.

The docs build caught a broken anchor on the way: the Kubernetes index resolves
with a trailing slash, so `../../reference/…` strips the version segment.
…ement-docs

# Conflicts:
#	website/docs/reference/spicepod/runtime.md
@github-actions

Copy link
Copy Markdown
Contributor

🚀 deployed to https://6901005e.spiceai-org-website.pages.dev

@bjchambers
bjchambers merged commit d0e5ec5 into trunk Aug 11, 2026
6 of 8 checks passed
@bjchambers
bjchambers deleted the ben/12489-cpu-entitlement-docs branch August 11, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants