Challenge - 5 Problems
Resource Monitoring Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Check CPU usage of a running container
You want to see the current CPU usage of a container named
webapp. Which command will show this information?Attempts:
2 left
💡 Hint
Use a command that shows live resource usage statistics for containers.
✗ Incorrect
The command 'docker stats webapp --no-stream' shows a snapshot of resource usage including CPU, memory, and network for the container named 'webapp'. Other options either show process info, logs, or incorrect fields.
💻 Command Output
intermediate1:30remaining
Memory usage output format
You run
docker stats --no-stream and see the memory usage column showing 50MiB / 500MiB. What does this mean?Attempts:
2 left
💡 Hint
The format is usually 'used / limit'.
✗ Incorrect
The memory usage column shows how much memory the container is currently using and the maximum allowed memory. '50MiB / 500MiB' means 50 MiB used out of 500 MiB limit.
❓ Configuration
advanced2:30remaining
Limit CPU usage of a container
You want to limit a container named
db to use at most 0.5 CPU cores. Which command correctly starts the container with this limit?Attempts:
2 left
💡 Hint
Use the flag that sets the number of CPUs directly.
✗ Incorrect
The '--cpus=0.5' flag limits the container to use half a CPU core. '--cpu-shares' is a relative weight, not a hard limit. '--cpu-quota' requires specific values and units. '--cpulimit' is not a valid Docker flag.
❓ Troubleshoot
advanced3:00remaining
Diagnose why container memory usage is high
A container
api is using more memory than expected. You want to check its memory limit and usage. Which sequence of commands helps you find this info?Attempts:
2 left
💡 Hint
One command shows current usage, the other shows configured limits.
✗ Incorrect
The 'docker stats' command shows current memory usage. 'docker inspect' with '{{.HostConfig.Memory}}' shows the memory limit set on the container. Other options either show logs, processes, or invalid fields.
✅ Best Practice
expert3:00remaining
Efficient resource monitoring setup for multiple containers
You manage many containers and want to monitor CPU and memory usage continuously with minimal overhead. Which approach is best?
Attempts:
2 left
💡 Hint
Look for a scalable and low-overhead monitoring solution.
✗ Incorrect
Using dedicated monitoring tools like cAdvisor or Prometheus exporters is efficient and scalable for many containers. 'docker stats' in a loop causes overhead. 'docker top' shows processes, not resource usage. Logs usually don't contain resource metrics.