Back to all scenarios
Scenario #414
Scaling & Load
Kubernetes v1.24, DigitalOcean

Horizontal Pod Autoscaler Triggered by Wrong Metric

HPA used memory instead of CPU, causing unnecessary scale-ups.

Find this helpful?
What Happened

Application scaled even under light CPU usage due to memory caching behavior.

Diagnosis Steps
  • 1HPA target: memory utilization.
  • 2kubectl top pods: memory always high due to in-memory cache.
Root Cause

Application design led to consistently high memory usage.

Fix/Workaround
• Switched HPA to CPU metric.
• Tuned caching logic in application.
Lessons Learned

Choose scaling metrics that reflect true load.

How to Avoid
  • 1Profile application behavior before configuring HPA.
  • 2Avoid memory-based autoscaling unless necessary.