Tech Tip #33: Right-size your Kubernetes requests

Your pods reserve four times the CPU they use.

Video created by explainapaper.com

The problem

Resource requests are set once, generously, and never revisited. The scheduler reserves the capacity, so nodes fill up on paper while sitting mostly idle.

The fix you can use today

  • Compare requests with actual usage over a few weeks.
  • Set requests near the 95th percentile of real use.
  • Review after each release; usage changes with the code.

Tools that help

  • GreenCode Constitution skill (GreenCode researchers): open-source energy principles and a catalogue of 37 energy anti-patterns that an AI coding agent can follow to find and fix waste like this
  • Kepler: exports energy estimates per pod and container on Kubernetes, using eBPF and hardware counters

How GreenCode helps

GreenCode helps tackle this by mapping a running estate and rebuilding it as infrastructure as code. It attributes energy and CO2e to the services that cause it, including services that barely run. More on this.

Tags

#kubernetes#right-sizing#docker

Sources

Transcript

Your pods may reserve four times the processor power they actually use. Resource requests are often set once, generously, and never checked again. The scheduler holds that space, even when nothing uses it. So your nodes look full on paper, while they sit mostly idle. You run more nodes than the work needs, and every node draws power. Here is the fix you can use today. Compare each request with real usage over a few weeks. Set requests near the ninety-fifth percentile of real use. Review them after each release, because usage changes with the code. GreenCode researchers list over-sized pods among the energy wastes to fix. GreenCode's Constitution skill can help an AI coding agent fix over-sized requests. Then check each pod's energy, using tools like Kepler. GreenCode helps tackle this by mapping your running systems and rebuilding them as code. It shows which services use the energy, including ones that barely run. That was GreenCode Tech Tip number thirty-three. Follow for the next tip, and find more on greencode.ai/tech-tips.

All GreenCode Tech Tips · All GreenCode videos

  • Tip #33
  • For Ops and infrastructure
  • Length 1:08
  • Category Containers, Kubernetes and serverless
GreenCode

Want this checked on your own system? Talk to the GreenCode team.

Get in touch