Case study
$1M saved on Spark-on-Kubernetes.
Cutting Spark compute by 49% with Karpenter-driven provisioning, checkpoint-aware spot handling, and per-job cost attribution.
Result: $1M+ saved · −49% spend
The problem
$2M+ a year, and climbing.
A data engineering organization was spending well over $2M a year running Apache Spark on a managed service. Jobs were over-provisioned, autoscaling was coarse, and spot savings were nearly impossible to unlock safely.
- Fixed executor sizing meant every job paid for peak memory, not average usage.
- Autoscaling was cluster-level, so individual jobs couldn’t react to load quickly.
- Spot interruption handling was fragile, so the team stayed on on-demand pricing.
- No visibility into per-job cost — tuning was guesswork.
The approach
Spark on EKS, tuned for cost.
- Spark on EKS via the Spark Operator. Jobs became first-class Kubernetes resources — versioned in Git, scheduled by controllers, observed through the same stack as every other workload.
- Karpenter for provisioning. Just-in-time node selection matched each job’s actual shape (CPU, memory, locality) instead of a fixed pool.
- Spot + graceful decommission. Interruption handlers triggered checkpoint-aware shutdown so lost executors didn’t fail whole stages.
- Executor rightsizing. Historical usage fed an advisor that proposed per-job executor cores/memory. Savings were validated against SLO burn, not just cost.
- Per-job cost attribution. Labels plus cost-allocation tags turned “is this job worth it?” from opinion into data.
The outcome
−49% spend, same reliability.
- $1M+ in annual savings — a 49% reduction in Spark compute spend versus the prior managed setup.
- Faster feedback for data engineers as job startup dropped once Karpenter replaced the old pooled autoscaler.
- Reliability held or improved — no net increase in job failure rate during or after the migration.
Principles applied
The principles behind it.
Clear trade-offs. Every pattern has a cost; I made them explicit before migrating.
Prove it with SLOs. Cost wins that degrade reliability aren’t wins.
Guardrails over heroics. Sizing and scaling live in code, not tribal knowledge.