Bird
0
0

You want to design a microservices system that scales pods horizontally based on both CPU usage and custom queue length metrics. Which approach best uses Horizontal Pod Autoscaler to achieve this?

hard📝 Trade-off Q15 of 15
Microservices - Orchestration with Kubernetes
You want to design a microservices system that scales pods horizontally based on both CPU usage and custom queue length metrics. Which approach best uses Horizontal Pod Autoscaler to achieve this?
AConfigure HPA with multiple metrics: CPU utilization and custom queue length, setting thresholds for both
BUse two separate HPAs, one for CPU and one for queue length, targeting the same deployment
CScale pods manually based on CPU and queue length metrics collected externally
DConfigure HPA to scale only on CPU and ignore queue length metrics
Step-by-Step Solution
Solution:
  1. Step 1: Understand HPA multi-metric support

    Horizontal Pod Autoscaler supports multiple metrics in a single configuration to scale pods based on combined criteria.
  2. Step 2: Evaluate options for best practice

    Configure HPA with multiple metrics: CPU utilization and custom queue length, setting thresholds for both uses multiple metrics in one HPA, which is efficient and avoids conflicts from multiple HPAs targeting the same deployment.
  3. Final Answer:

    Configure HPA with multiple metrics: CPU utilization and custom queue length, setting thresholds for both -> Option A
  4. Quick Check:

    Single HPA with multiple metrics = A [OK]
Quick Trick: Use one HPA with multiple metrics for combined scaling [OK]
Common Mistakes:
MISTAKES
  • Using multiple HPAs on same deployment causing conflicts
  • Ignoring custom metrics support
  • Relying only on CPU metrics

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes