Skip to content

Kubernetes requests that match what workloads use

The CostReveal team, , 2 minute read

A container's request is what the scheduler reserves for it, whether it uses it or not. Set a request of 8 cores for a service that peaks at 6, and the cluster keeps 2 cores free for it on every node it runs on. Multiply that by every service whose request was set once, at launch, and never looked at again, and a cluster runs more nodes than its work needs.

The opposite mistake costs differently. A container that uses more than it requests is throttled when its node is busy, and evicted first when memory runs short. Both are worth knowing about, and both are visible in the metrics a cluster already sends.

From two weeks of use

CostReveal reads each container's requests and use from the OpenTelemetry Collector that already divides your cluster's cost. For every container with at least 7 days of metrics in the last 14, it takes:

  • CPU at the 95th percentile of a pod's use on the busiest day, so a brief spike does not set the request, but a busy afternoon does.
  • Memory at the most it reached, since a container that runs out of memory is stopped, not slowed.

The recommended request is that use with 15 percent headroom, rounded up to a millicore or a MiB, written as a manifest writes it, such as 6886m or 14838Mi. A request 30 percent or more beyond use is marked Lower; one below use, Raise; a container with no request, Set a request. A resource the Collector sends no use of is Not measured, never taken as unused.

Priced from your bill

Each container to lower comes with what the capacity it frees is worth a month: what its workload's CPU and memory cost last month, amortized, so a node a Savings Plan covers counts at what it costs, for the share of its requests it would no longer take. That figure is saved once fewer or smaller nodes run, the same way idle capacity is, which is why it is stated as capacity freed rather than money already saved.

Worked through like any saving

Containers to lower appear in Insights with the rest of your savings, beside each cloud's own recommendations and each cluster's idle capacity. Each can be given an owner, a status and a comment thread, so a platform team can work through them one service at a time, and a container drops off the list once its requests match its use.

Keep reading