Planning bounded load tests and resource budgets
A resource test should answer a specific question while remaining within an agreed safety budget. Start with a synthetic workload, fixed input, bounded concurrency and explicit stop criteria. Do not intentionally trigger host OOM, PID exhaustion or sustained CPU saturation. The supplied offline model performs arithmetic only.
Worked example
This is an offline lesson. Scenarios are fictional and Docker commands are unexecuted. Any optional execution requires an approved disposable VM, a reviewed preloaded image with verified digest, blocked external access and appropriate resource limits. No resource exhaustion or host-policy change is required. Before any authorized optional observation, verify the effective daemon endpoint including overrides, exact object ID and observation window. Bound collection time and output bytes; do not generate resource pressure or export private telemetry. Mark unavailable measurements NOT RUN.
Synthetic budget (not benchmark data)Memory: limit=128 MiB, baseline=32 MiB, per worker=8 MiB, reserve=32 MiBTasks: limit=64, baseline=8, per worker=3, reserve=8Descriptors: soft=256, baseline=32, per worker=12, reserve=32Max workers by resource: 8, 16, 16 -> model cap=8Plan: 1 then 2 then 4 workers, at most 5 seconds each; no external trafficThe minimum of the three resource-specific caps bounds this simplified linear model. It is not a recommendation to run eight workers: real memory peaks, latency, thread pools and descriptor usage may not be linear. In a separately approved disposable VM with a reviewed preloaded image, no network or host mounts, use an application-owned timeout plus an external supervisor deadline and reserve host capacity. Start with the smallest run; stop if measurements exceed agreed thresholds or errors occur. Record workload, image identity, effective limits, time, peak observations and completion. Compare one variable at a time; no benchmark or Docker execution is supplied. Run the included Python tests for arithmetic only. With doubled memory cost the cap is four. The descriptor column assumes a single owning process; if ownership is distributed, the descriptor model must be redesigned. The helper is integer arithmetic only; it validates no effective resource configuration, workload latency, or safety of the proposed test.
Common mistake
The model cap is a planning estimate, not proof of safe capacity or a load generator.
Manual practice
Recalculate the model if per-worker memory doubles to 16 MiB. Write one stop rule and one measurement to collect before changing a limit.
Worksheet: lab-fixtures/docker-resource-management/08-bounded-lab/scenario.txt.
The synthetic model is in lab-fixtures/docker-resource-management/budget-model/. Use it for reasoning practice only, not as a load test or resource controller.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Planning bounded load tests and resource budgets — Knowledge check
Apply resource management reasoning in a fictional scenario.
Which resource limits the original synthetic plan?
What is the new memory cap with 16 MiB per worker?
What is the purpose of the model?