Kubernetes vs AWS Lambda: When Serverless Actually Saves You Money

· Tech· Infrastructure
kubernetesaws-lambdaserverlesscloud-cost

The debate between Kubernetes and AWS Lambda rarely stays in engineering territory for long. It almost always drifts into cost — and understandably so. Compute is often the second-largest line item on a startup's AWS bill, and the gap between "we chose the right architecture" and "we're burning cash for no reason" is often just a matter of traffic shape.

I've seen teams confidently migrate to serverless to cut costs, only to watch their monthly bill climb. I've also seen teams running Kubernetes clusters idling at 8% utilization, paying for headroom they never use. The honest answer is that neither model is inherently cheaper — it depends almost entirely on your workload's traffic pattern, and most engineers never do the actual math before committing.

The Lambda Pricing Model in Plain Terms

AWS Lambda charges on two axes: the number of invocations and the duration of each invocation (measured in GB-seconds, meaning memory allocated × seconds of execution). As of mid-2026, you get one million free requests per month and 400,000 GB-seconds of compute. After that, you pay roughly $0.20 per million requests and $0.0000167 per GB-second.

This pricing model is genuinely excellent if your traffic is spiky and unpredictable. A function that handles 500,000 requests in a burst over three hours, then goes quiet for a week, costs almost nothing for that quiet week. You pay for what you use — the promise of serverless holds.

Where Lambda starts to hurt is sustained, high-throughput workloads. Imagine a function running at 128 MB for an average of 200ms per request, handling 50 million requests per month. The math comes out to roughly $10 in request charges plus about $27 in compute charges — around $37 total. That sounds manageable until you realize that a single t3.small instance on EC2 (or a similar pod on a small EKS node) can comfortably handle that volume for around $15–18 per month. Serverless just became more expensive.

Where Kubernetes Wins and Where It Doesn't

Kubernetes — or more practically, EKS with a managed node group — has a different cost structure. You pay for the underlying EC2 instances continuously, regardless of whether a pod is serving traffic. This is the core tradeoff: you're buying capacity upfront, not paying per-request.

At low, consistent traffic, this is a bad deal. If you're running a small internal tool that gets 10,000 requests per day, you're paying for a cluster that spends most of its time waiting. A t3.medium node at roughly $30/month to serve 300,000 monthly requests is hard to justify when Lambda would cost under $1 for the same load.

But as traffic grows and stabilizes, the math flips. The break-even point for most workloads — assuming average Lambda function memory of 512 MB and execution time of 300ms — tends to land somewhere between 5 and 15 million requests per month, depending on your specific function duration. Above that threshold, a well-tuned Kubernetes cluster almost always wins on pure compute cost. Below it, Lambda wins — often decisively.

There's a second factor that rarely appears in back-of-envelope math: cold starts. Lambda functions that haven't been invoked recently spin up a new execution environment, adding anywhere from 100ms to several seconds of latency depending on your runtime and package size. Provisioned Concurrency solves this, but it costs extra — and once you're paying for provisioned concurrency at scale, you've essentially re-invented the concept of always-on instances. At that point, Kubernetes may already be cheaper and more predictable.

The Hidden Costs That Skew the Comparison

Pure compute cost is only part of the picture. Lambda functions calling downstream services — RDS, DynamoDB, S3, other Lambdas — incur data transfer and API call charges that compound at scale. A microservice architecture that looks clean on a whiteboard can generate significant egress fees when each function is invoking two or three others per request.

Kubernetes introduces its own overhead: the EKS control plane charges around $72/month regardless of cluster size, and engineering time for cluster management, autoscaling configuration, and observability tooling is real. A two-person team spending even two hours per week managing cluster health is paying a hidden operational tax that doesn't show up in AWS Cost Explorer.

This is why the comparison isn't purely financial. Teams without dedicated platform engineers often find Kubernetes operational overhead disproportionately expensive — not in dollars, but in attention. Lambda's zero-ops promise has genuine value when your team would rather ship features than manage pod scheduling.

A Practical Heuristic Worth Keeping

After working through this calculation on a few different projects, the heuristic I've settled on is this: if your workload exceeds roughly 10 million requests per month with a relatively stable pattern, start modeling Kubernetes costs seriously. Below that threshold, Lambda is almost certainly the right default — not because it's always cheaper, but because the operational simplicity compounds in your favor at smaller scale.

The most expensive mistake isn't choosing the wrong compute primitive. It's choosing it without running the numbers first, and then not revisiting that choice as traffic grows. Cloud architecture decisions calcify surprisingly fast — what started as a convenient Lambda function becomes a distributed system of forty functions three years later, all of them costing more than a modestly-sized EKS cluster would have.

Build the spreadsheet before you build the system. The cost curve will tell you more than any architecture diagram will.

Comments

No comments yet. Be the first!

    164 posts in 테크

    15 / 164