Recall & Review
beginner
What are resource limits in Docker?
Resource limits in Docker are settings that control how much CPU, memory, and other resources a container can use to prevent it from using too much and affecting other containers or the host system.
Click to reveal answer
beginner
Why is it important to set memory limits on Docker containers?
Setting memory limits prevents a container from using all the host's memory, which can cause the system to slow down or crash. It helps keep the system stable and fair for all containers.
Click to reveal answer
intermediate
What happens if a Docker container exceeds its CPU limit?
If a container exceeds its CPU limit, Docker will restrict its CPU usage, slowing down the container's processes to keep the host system responsive and fair to other containers.
Click to reveal answer
intermediate
How do resource limits help in a multi-container environment?
Resource limits ensure that no single container hogs all the resources, allowing multiple containers to run smoothly together without one causing others to slow down or fail.
Click to reveal answer
beginner
Name two Docker flags used to set resource limits.
Two common Docker flags for resource limits are
--memory to limit memory usage and --cpus to limit CPU usage.Click to reveal answer
What is the main reason to set resource limits on Docker containers?
✗ Incorrect
Resource limits prevent containers from using excessive resources, which helps keep the system stable and fair.
Which Docker flag limits the memory a container can use?
✗ Incorrect
The --memory flag sets the maximum memory a container can use.
If a container uses more CPU than its limit, what happens?
✗ Incorrect
Docker restricts the container's CPU usage to keep the system responsive.
Why are resource limits especially important in multi-container setups?
✗ Incorrect
Resource limits ensure fair resource sharing among containers.
Which resource is NOT typically limited by Docker resource flags?
✗ Incorrect
Docker does not provide built-in flags to limit network bandwidth directly.
Explain why setting resource limits on Docker containers helps maintain system stability.
Think about what happens if one container uses all memory or CPU.
You got /4 concepts.
Describe how you would use Docker flags to limit a container's CPU and memory usage.
Use --memory to limit RAM and --cpus to limit CPU cores.
You got /4 concepts.