Resource Efficiency

Overview

Resource efficiency measures how well you're using the resources you're paying for.

The fundamental question:

"Of all the CPU and memory I'm paying for, how much am I actually using?"

Why it matters:

  • High efficiency (70-80%) → Getting value for money
  • Low efficiency (<30%) → Paying for waste

Kubeadapt's approach:

  1. Measure actual resource usage
  2. Compare to resource requests (what you pay for)
  3. Calculate efficiency percentages
  4. Identify opportunities to improve

The Efficiency Problem

What is Paid For vs. What is Used

In Kubernetes, costs are based on resource requests, not actual usage.

Example deployment:

yaml
1resources: 2```yaml 3 4 requests: 5 cpu: "2000m" 6 memory: "4Gi" 7

What you might actually use:

text
1 2Actual CPU usage (P95): 400m (20% of requested) 3Actual memory usage (P99): 1.5Gi (37.5% of requested) 4

Your efficiency:

text
1 2CPU efficiency: 400m / 2000m = 20% 3Memory efficiency: 1.5Gi / 4Gi = 37.5% 4

Translation: 80% of CPU budget and 62.5% of memory budget are wasted.

Industry reality: Average Kubernetes CPU efficiency is just 10-13%.


How Efficiency Is Calculated

The Core Concept

Efficiency measures how well requested resources are being utilized:

text
1 2Resource Efficiency = (Observed Usage / Requested Resources) × 100% 3

How Usage is Measured:

Kubeadapt uses percentile-based analysis to calculate observed usage:

  • CPU Usage: Based on P95 percentile of actual consumption
  • Memory Usage: Based on P99 percentile of actual consumption
  • Time-weighted: Recent data carries more weight than older data (30-day lookback with recency bias)

The percentile approach varies by environment:

  • Production workloads: P95 for CPU, P99 for memory (conservative)
  • Non-production workloads: P50 for both CPU and memory (aggressive cost optimization with high limits as safety buffer)

Efficiency Levels Explained

CPU Efficiency

Excellent (70-85%)

text
1 2Requested: 1000m 3Using: 700-850m 4Actions to be taken: None - well-sized with minimal waste 5

Good (50-70%)

text
1 2Requested: 1000m 3Using: 500-700m 4Actions to be taken: Monitor - acceptable efficiency, minor optimization possible 5

Moderate (30-50%)

text
1 2Requested: 1000m 3Using: 300-500m 4Actions to be taken: Right-size - moderate waste, reduce requests by 20-40% 5

Poor (15-30%)

text
1 2Requested: 1000m 3Using: 150-300m 4Actions to be taken: Right-size urgently - significant waste, reduce requests by 40-60% 5

Very Poor (<15%)

text
1 2Requested: 1000m 3Using: <150m 4Actions to be taken: Right-size immediately - severe over-provisioning, reduce by 60-80% 5

Memory Efficiency

text
1**Excellent (75-90%)**

Requested: 4Gi Using: 3-3.6Gi Actions to be taken: None - well-sized

text
1**Good (60-75%)** 2

Requested: 4Gi Using: 2.4-3Gi Actions to be taken: Monitor - acceptable efficiency

text
1**Moderate (40-60%)**

Requested: 4Gi Using: 1.6-2.4Gi Actions to be taken: Right-size - reduce requests

text
1**Poor (20-40%)**

Requested: 4Gi Using: 0.8-1.6Gi Actions to be taken: Right-size urgently - significant waste

text
1**Very Poor (<20%)**

Requested: 4Gi Using: <800Mi Actions to be taken: Right-size immediately - severe over-provisioning

text
1--- 2

Cluster-Level Efficiency

Aggregate Metrics

Cluster efficiency:

text
1 2Total requested CPU across all pods: 450 cores 3Total actual usage: 180 cores 4Cluster CPU efficiency: 180 / 450 = 40% 5 6Total requested memory: 1.8 TB 7Total actual usage: 720 GB 8Cluster memory efficiency: 720 / 1800 = 40% 9

What this means:

  • Paying for 450 cores, using 180
  • Paying for 1.8 TB, using 720 GB
  • 60% waste opportunity

Node-Level Efficiency

Node capacity utilization:

text
1 2Node: m5.2xlarge (example - AWS instance type) 3Total capacity: 8 cores, 32 GB 4 5Allocated (requests): 6 cores, 24 GB (75% node utilization) 6Actual usage: 3 cores, 15 GB (37.5% actual utilization) 7 8Node efficiency: 3 / 6 = 50% CPU, 15 / 24 = 62.5% memory 9

Note: This example uses AWS EC2 instance types for illustration. Kubeadapt supports AWS, GCP, and Azure. Node type examples will vary based on your cloud provider.

Two layers of waste:

  1. Scheduling waste: Node has 25% idle capacity (2 cores, 8 GB unused)
  2. Over-provisioning waste: Allocated pods use 50% of their requests

Total waste:

text
1 2Paying for: 8 cores 3Using: 3 cores 4Total efficiency: 3 / 8 = 37.5% 5

Namespace Efficiency

text
1 2**Per-team visibility:** 3

Namespace: backend Total requested: 80 cores, 320 GB Total usage: 24 cores, 160 GB

CPU efficiency: 30% Memory efficiency: 50% Overall efficiency: 40%

Current waste: 60% of namespace resources Potential efficiency improvement with 70% target: 30 percentage point gain

text
1--- 2

Efficiency vs. Utilization

Key Difference

Efficiency = Usage / Requests (what you pay for) Utilization = Usage / Capacity (what's available)

Example:

text
1 2Node capacity: 8 cores 3Pod requests: 2 cores 4Pod usage: 400m 5 6Efficiency: 400m / 2000m = 20% (usage vs. requests) 7Utilization: 400m / 8000m = 5% (usage vs. node capacity) 8

Why both matter:

Low efficiency:

  • Problem: Over-provisioning
  • Solution: Right-size pod requests

Low utilization:

  • Problem: Poor bin-packing
  • Solution: Add more pods or reduce node count

The Ideal State

Well-optimized cluster:

text
1 2Node capacity: 8 cores 3Pod requests: 7 cores (87.5% utilization) 4Actual usage: 5 cores (71% efficiency) 5 6High utilization (filling nodes) 7Good efficiency (requests match usage) 8

Poorly optimized cluster:

text
1 2Node capacity: 8 cores 3Pod requests: 4 cores (50% utilization) 4Actual usage: 800m (20% efficiency) 5 6Low utilization (wasting nodes) 7Poor efficiency (requests too high) 8

text
1## Improving Efficiency Through Right-Sizing 2 3Kubeadapt's [right-sizing](/docs/v1/concepts/rightsizing) is designed to improve both resource-level and cluster-level efficiency: 4 5**Resource-Level Efficiency:** 6 7When right-sizing is properly applied to individual workloads: 8- Pod requests align with actual usage patterns 9- CPU efficiency improves from industry average (10-13%) to target ranges (60-75%) 10- Memory efficiency improves to target ranges (70-85%) 11 12**Cluster-Level Efficiency:** 13 14As workloads are right-sized across the cluster: 15- Aggregate resource waste decreases 16- Node utilization improves through better bin-packing 17- Overall cluster efficiency increases, reducing infrastructure costs 18 19**How It Works:** 20 211. Kubeadapt analyzes actual usage patterns (30-day lookback with recency weighting) 222. Generates right-sizing recommendations based on P95/P99 percentiles 233. Applies environment-specific strategies (production vs. non-production) 244. Monitors efficiency improvements post-implementation