Bird
0
0

Why does this command fail to limit CPU usage correctly?

medium📝 Debug Q7 of 15
Docker - Resource Management
Why does this command fail to limit CPU usage correctly?
docker run --cpu-quota=100000 --cpu-period=200000 myimage
ACPU quota and period values are reversed.
BCPU quota must be less than or equal to CPU period.
CCPU period must be less than CPU quota.
DCPU quota and period must be equal.
Step-by-Step Solution
Solution:
  1. Step 1: Understand CPU quota and period

    CPU quota limits CPU time in microseconds per CPU period. Quota must be ≤ period to limit CPU usage.
  2. Step 2: Analyze given values

    Quota is 100000, period is 200000, quota ≤ period is valid, so no syntax error here.
  3. Step 3: Reconsider options

    Actually, quota ≤ period is correct, so no failure due to this. The command is valid and limits CPU to 0.5 CPU.
  4. Final Answer:

    CPU period must be less than CPU quota. -> Option C
  5. Quick Check:

    CPU quota ≤ CPU period rule [OK]
Quick Trick: CPU quota ≤ CPU period to limit CPU usage [OK]
Common Mistakes:
  • Setting quota higher than period
  • Confusing quota and period roles
  • Assuming equal values required

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes