Bird
0
0

If a container is started with:

medium📝 Command Output Q5 of 15
Docker - Resource Management
If a container is started with:
docker run --cpu-shares=512 --cpus=1 myimage
What does the --cpu-shares value affect?
AIt sets the relative CPU weight compared to other containers.
BIt sets the absolute CPU limit to 512 CPUs.
CIt reserves 512 CPU cores for the container.
DIt disables CPU usage for the container.
Step-by-Step Solution
Solution:
  1. Step 1: Understand --cpu-shares meaning

    The --cpu-shares option sets the relative CPU weight for the container compared to others sharing the CPU.
  2. Step 2: Differentiate from absolute limits

    It does not set absolute CPU limits or reservations, only relative priority when CPU is contended.
  3. Final Answer:

    It sets the relative CPU weight compared to other containers. -> Option A
  4. Quick Check:

    --cpu-shares = relative CPU weight [OK]
Quick Trick: CPU shares set relative priority, not absolute limits [OK]
Common Mistakes:
  • Thinking --cpu-shares sets absolute CPU limit
  • Confusing shares with reservation or limit
  • Assuming it disables CPU

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes