Cloud Technology Community Question

How can I optimize cloud costs by right-sizing Kubernetes resource requests and limits?

Posted on 2025-01-10 • In Cloud Technology • By Christopher Lee

Our EKS bill is skyrocketing because of over-provisioned nodes. I suspect our Pod resource requests are way too high, but I'm afraid of causing performance throttling or OOM errors if I lower them. Is there a safe methodology or tool to calculate the ideal CPU and memory settings?

3 Answers 12,149 Views

All answers to this question 3 Answers

Barbara Davis Answered on 2025-01-12
Answered

The safest way to right-size is to use the Vertical Pod Autoscaler (VPA) in "Recommender" mode. It will observe your actual usage over time and suggest values without actually restarting your pods. You can also use open-source tools like Goldilocks or Kubecost to visualize the gap between what you've requested and what you're actually consuming. Generally, your "Requests" should be based on the average usage, while "Limits" should be set to the 95th percentile of your burst peaks to prevent a single pod from hogging the entire node’s resources.

William Wilson Answered on 2025-01-13
Answered

Have you considered using Spot Instances for your non-critical worker nodes? This can reduce costs by up to 70-90% regardless of your resource settings.

Christopher Lee Commented on 2025-01-14
Commented

Spot instances are great for dev/staging, William, but for production, you need to be careful. You must implement Pod Disruption Budgets (PDBs) and ensure your application handles graceful shutdowns. If the spot capacity is reclaimed, your pods need to move quickly. Combining spot instances with right-sizing via VPA is the ultimate strategy for a lean, cost-efficient Kubernetes infrastructure.

Jennifer Clark Answered on 2025-01-15
Answered

Don't forget the Horizontal Pod Autoscaler (HPA). It's better to have many small pods that scale up during traffic spikes than a few massive, over-provisioned pods.

Barbara Davis Commented on 2025-01-16
Commented

Exactly, Jennifer. Using HPA based on custom metrics like request-per-second often yields better cost-efficiency than just scaling on basic CPU/RAM metrics alone.

Write a Comment

Your email address will not be published. Required fields are marked (*)

Join the LearnersEra Community

Ask questions, share knowledge and learn from professionals across technology, project management and certification topics.

Change Country and Nearest City

Select your country and nearest city to see courses available in your region.