Lambda vs Fargate vs Cloud Run: what each actually costs
All four platforms run the same code. They differ in what you pay for: Lambda and Cloud Run (request-billed) charge for the time requests are in flight, while Fargate and EC2 charge for capacity that is up whether or not anyone calls it. That one difference decides most cost comparisons. This page gives an estimate, not a bill.
How each is billed
Lambda: a fee per million requests plus GiB-seconds of memory x duration. One request per environment, so concurrency is 1.
Cloud Run (request-based): a request fee plus vCPU-seconds and GiB-seconds while any request is in flight; one instance serves many requests at once, so the same work is billed as fewer seconds.
Fargate: vCPU-hours and GiB-hours for every task, all month, sized for your peak and at least two tasks for availability.
EC2: the node, all month, at a lower per-vCPU price but with bin-packing waste you must size for.
Why the answer flips with volume
Pay-per-request cost is a straight line: double the requests, double the bill. Always-on cost is a floor with steps: nearly flat until traffic outgrows the current tasks. At low volume the line sits under the floor, so Lambda or Cloud Run is cheapest. Past the crossing, the floor wins, often by a large factor. At 10 million 120 ms requests a month the pay-per-request options are cheapest; at 500 million with concurrency 20, Fargate costs a small fraction of Lambda.
Three inputs that move the break-even most
Duration: long requests make Lambda GiB-seconds dominate the bill.
Concurrency: a container that serves 20 requests at once is paid for once, not 20 times.
Peak to average: always-on capacity is sized for the peak, so spiky traffic keeps pay-per-request competitive far longer.
What the comparison leaves out
Free tiers, Savings Plans and committed-use discounts, data transfer, load balancers and NAT gateways, cold-start latency, provisioned concurrency, autoscaling lag, and the engineering time to operate containers. A saving of a few dollars rarely justifies a migration; a saving of thousands a month usually does.
Does this connect to my AWS or Google Cloud account?
No. It reads the numbers you type and never contacts a cloud or any server. It cannot see your real invoice, free tier, savings plans or discounts, so every figure is arithmetic on list prices you can edit. This is an estimate, not a bill.
Why does the break-even move so much between workloads?
Pay-per-request platforms charge for every request-second, so cost grows in a straight line with traffic. Always-on platforms charge for a floor of capacity, so cost is flat until traffic outgrows it. Duration, memory and how many requests one container handles at once decide where the lines cross.
What does concurrency mean here?
How many requests one container or task serves at the same time. Lambda runs one request per environment. Cloud Run and Fargate containers usually handle 10 to 80, which is the main reason they get cheaper than Lambda at steady volume.
What does this leave out?
Free tiers, committed-use and Savings Plans discounts, data transfer, load balancer and NAT costs, cold starts and latency, provisioned concurrency, autoscaling lag, ops time and region differences. Treat the result as a first filter, then check your own bill.