| AWS Lambda
$0.20 per 1M requests
$0.0000166667 for every GB-second
SLA 99.95% Lets assume
- 2000 calls/sec
- each call is 1 sec duration
- 0.128 GB/sec/call
- db, storage iops will be the same if deployed as K8s
- 5x9s SLA (imples a three region deployment) requests per year = 2000 * 3600 * 24 * 365 = 63072000000
request costs = 0.2 * 63072000000 / 1000000 = 12,614 USD GB/sec per year = 0.128 * 2000 * 3600 * 24 * 365 = 8073216000
GB/sec costs = 8073216000 * 0.0000166667 = 134,553.87 Total cost = 12614 + 134553.87 = 147,167.87 USD The equivalent K8s would be
- three clusters
- 2000 cores (more likely 10% more = 2200)
- 256GB memory Three clusters will require 3000 cores to cater for region loss
- 3000 cores on 32 core machines => 94 machines
- round up to 99 machines to give vm level redundancy
=> 33 machines per cluster Azure D32a_v4 (32 core, 128 GiB, 800 GiB storage) = $1.84/hour PAYG; $0.5704/hour Spot DS32a_v4 at spot pricing = 99 * 0.5704 * 24 * 365 = 494673.696 USD Plus FTE support (e.g. n FTEs @ 100k USD) With 2 FTEs total is 694,673 USD Summary: AWS Lambda is 4.7x cheaper than a Kubernetes solution |
You should redo the calculations with 1gb of memory for Lambda and like 30 machines would be generous
Concurrency is key. Requests don't cost much when they're just waiting for other things, but Lambda continues to pile costs on for every increase in concurrency.
APIs should maybe use a tiny fraction actual real CPU time. Perhaps BBCs are different - In order to make an actual fair comparison and properly predict what they would need in servers, greater detail is needed than what you have available to you, but I think your estimations are off by a significant amount.