0
0
Dockerdevops~20 mins

Why resource limits matter in Docker - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Resource Limits Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Why set CPU limits on Docker containers?

What is the main reason to set CPU limits on Docker containers?

ATo prevent one container from using all CPU and slowing down others
BTo increase the container's network speed
CTo allow the container to use unlimited memory
DTo make the container start faster
Attempts:
2 left
💡 Hint

Think about how multiple containers share the same machine's CPU.

💻 Command Output
intermediate
1:30remaining
Output of Docker memory limit command

What output will this command produce?

docker run --rm -m 100m busybox free -m
AShows an error about invalid memory limit
BShows zero memory available
CShows total memory as the host machine's full RAM size
DShows total memory around 100 MB available inside the container
Attempts:
2 left
💡 Hint

The -m flag sets memory limit for the container.

Troubleshoot
advanced
2:00remaining
Container crashes due to memory limit

A container crashes with an 'Out of Memory' error. Which Docker option likely caused this?

A--cpus=2
B--memory=50m
C--network=host
D--restart=always
Attempts:
2 left
💡 Hint

Think about which option limits memory usage.

🔀 Workflow
advanced
2:30remaining
Order steps to set resource limits on a Docker container

Put these steps in the correct order to run a Docker container with CPU and memory limits.

A1,2,3,4
B2,1,3,4
C1,3,2,4
D3,1,2,4
Attempts:
2 left
💡 Hint

Think about planning, running, testing, then deploying.

Best Practice
expert
2:00remaining
Why avoid unlimited resource usage in containers?

What is the best reason to avoid running containers without resource limits?

AIt improves container network security
BContainers will run faster without limits
CUnlimited resource use can cause host system slowdown or crashes
DIt reduces container image size
Attempts:
2 left
💡 Hint

Think about what happens if one container uses too much CPU or memory.