Senior · Docker and Kubernetes
Requests, limits and Go runtime budgets
What happens when a Pod exceeds CPU or memory limits?
Try explaining this aloud before opening the answer. State your assumptions and trace a boundary case.
Reveal a strong answer
Requests guide scheduling and resource allocation. CPU limits can throttle execution; memory pressure can lead to an OOM kill. A runtime memory target is not the same boundary as the cgroup process limit.
Set Go runtime and application concurrency with measured headroom for stacks, native allocations, buffers and dependencies. Inspect the effective runtime configuration for the deployed Go version instead of assuming host CPU count is the available budget.
Watch throttling, working set/RSS, restart reason, GC and request latency together. Resource settings should come from representative load and startup behavior, not a copied manifest.
Common trap
GOMEMLIMIT cannot prevent every OOM kill because it is soft and does not account for every process byte.
Try it
A256 MiB Pod dies while Go heap is only120 MiB. What else may consume the budget?
Worked solution
Goroutine stacks, runtime metadata, native allocations, mapped memory, buffers and other process costs may matter. Read cgroup/RSS and termination evidence, then reduce retention/concurrency or change the budget with measured headroom.
Change the constraint
Why might increasing a CPU limit improve p99 without changing average request CPU work?
How did you do?
Self-assessment, not a compiler pass or interview score. Explain the reasoning unaided before marking understood.
Not marked. Progress stays on this browser, separate from course completion.
Primary references
Checked 2026-10-20. Use documentation for your pinned runtime, driver and tool version.