DCA Financial Management & Budgeting 5 — Questions and Answers
Question 1: Which Docker Swarm placement constraint would you use to schedule cost-intensive GPU workloads only on GPU-equipped nodes?
- --constraint 'node.role==manager'
- --constraint 'node.labels.gpu==true' (Correct answer)
- --preference 'spread=node.id'
- --reserve-memory 8g
Correct answer: --constraint 'node.labels.gpu==true'
Custom node labels like gpu=true combined with placement constraints route containers only to nodes with that capability.
Question 2: A container's --cpu-quota is set to 50000 with the default --cpu-period of 100000. What percentage of a single CPU can this container use?
- 100%
- 25%
- 50% (Correct answer)
- 200%
Correct answer: 50%
cpu-quota divided by cpu-period equals 50000 / 100000 = 0.5, so the container can consume at most 50% of one CPU per period.
Question 3: Which open-source tool stack is commonly integrated with Docker to provide container-level resource metrics for cost attribution and chargeback?
- Docker Bench Security
- cAdvisor with Prometheus and Grafana (Correct answer)
- Docker Registry UI
- Portainer Community Edition
Correct answer: cAdvisor with Prometheus and Grafana
cAdvisor exposes per-container resource metrics that Prometheus scrapes and Grafana visualizes, enabling department-level cost reporting.
Question 4: What is the effect of setting --blkio-weight=100 on a container compared to the default weight of 500?
- The container gets 5x more I/O bandwidth than default
- The container gets proportionally less block I/O bandwidth than default-weight containers (Correct answer)
- Block I/O is disabled for the container
- The container network I/O is throttled
Correct answer: The container gets proportionally less block I/O bandwidth than default-weight containers
blkio-weight is a relative value; 100 vs 500 means the container gets roughly 1/5 of the I/O share compared to a default-weighted container.
Question 5: An engineering team wants to reduce Docker image pull times and egress costs in a multi-region deployment. Which architecture best achieves this?
- Pull all images from Docker Hub regardless of region
- Deploy a regional Docker registry mirror or pull-through cache close to each cluster (Correct answer)
- Use larger instance types to download images faster
- Disable layer caching to ensure fresh pulls
Correct answer: Deploy a regional Docker registry mirror or pull-through cache close to each cluster
A regional registry mirror stores images locally, cutting cross-region egress fees and reducing pull latency.
Question 6: Which Docker Swarm resource flag sets a hard memory cap ensuring a container is OOM-killed before starving co-located services?
- --reserve-memory
- --limit-memory (Correct answer)
- --memory-swap
- --oom-kill-disable
Correct answer: --limit-memory
--limit-memory sets a hard memory cap so the container is OOM-killed before it can starve neighboring containers on the same node.
Question 7: A startup evaluates Docker Hub free tier vs self-hosting a registry. Which factor most strongly favors self-hosting at scale?
- Docker Hub free tier has no rate limits
- High pull volume that would exceed Docker Hub rate limits and incur subscription costs (Correct answer)
- Self-hosted registries support more image tags
- Docker Hub does not support private repositories
Correct answer: High pull volume that would exceed Docker Hub rate limits and incur subscription costs
At high pull volumes, Docker Hub rate limits and paid tier costs often exceed the operational cost of running a self-hosted registry.
Which Docker Swarm placement constraint would you use to schedule cost-intensive GPU workloads only on GPU-equipped nodes?