Bird
0
0

You want to monitor resource usage of containers but only for those using more than 50% CPU. How can you achieve this?

hard📝 Application Q9 of 15
Docker - Resource Management
You want to monitor resource usage of containers but only for those using more than 50% CPU. How can you achieve this?
ARun 'docker stats --only-high-cpu 50'
BRun 'docker stats' and filter output with a script checking CPU > 50%
CUse 'docker stats --cpu-threshold 50'
DUse 'docker stats --filter cpu>50%'
Step-by-Step Solution
Solution:
  1. Step 1: Check docker stats filtering capabilities

    Docker stats does not support filtering by CPU usage directly via flags.
  2. Step 2: Use external filtering

    You must run docker stats and pipe output to a script or command that filters containers with CPU usage above 50%.
  3. Final Answer:

    Run 'docker stats' and filter output with a script checking CPU > 50% -> Option B
  4. Quick Check:

    Docker stats needs external filtering for CPU thresholds [OK]
Quick Trick: Filter docker stats output externally for CPU thresholds [OK]
Common Mistakes:
  • Expecting docker stats to filter by CPU
  • Using non-existent flags
  • Assuming built-in threshold options

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes