Production resource and log budgets
Worked example
This is an offline lesson. Data are fictional and Docker commands are unexecuted. Any optional execution requires an authorized disposable VM, a verified context, synthetic data, restricted access and no external transmission. Do not collect secrets or private output. Use only the fictional worksheet for this exercise. Before a separately authorized read-only server query, verify the effective endpoint including environment overrides, project or cluster identity, and access scope. Never deploy the fragments, use real credentials or transmit private inspection output.
Fictional memory budget (MiB):Host total 4096; host reserve 768; backup peak 512proxy 256; app 1024; db 1024remaining = 4096 - 768 - 512 - 256 - 1024 - 1024 = 512Illustrative service fragment (not a complete file):mem_limit: 1024mcpus: 1.0pids_limit: 128logging: driver: local options: max-size: "10m" max-file: "3"Add concurrent workload peaks and leave room for engine, OS, monitoring and recovery. The 512 MiB remainder is an arithmetic result, not a measured safe margin. CPU limits can cause throttling, and a memory limit can cause OOM termination. Record working-set behavior, latency and saturation under representative bounded load; never intentionally exhaust shared systems. The local logging driver supports rotation; the example limits file size and count, but actual disk use includes metadata, compression and other files. Include database growth, image storage and backup staging in a separate disk budget. Confirm runtime enforcement on the target engine. Adding a second 1024 MiB app changes the arithmetic remainder to minus 512 MiB. Reject the proposal until the budget changes and bounded load evidence supports the new plan. The logging settings are per container, not a total host storage cap.
Common mistake
Do not sum only application memory limits and assign the entire host to containers. The host and backup operations need capacity too.
Manual practice
Increase app replicas from one to two, retaining the same per-instance limit. Calculate the new margin and propose a safe decision before deployment. Add a disk budget for logs and backups.
Worksheet: lab-fixtures/docker-production-deployment/05-budgets/scenario.txt.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Production resource and log budgets — Knowledge check
Interpret production deployment evidence and make a safe operational decision.
What is the fictional remaining memory?
What happens to the margin when another 1024 MiB app instance is added?
What does a positive arithmetic margin prove?