CrashLaker / pubblog

0 stars 0 forks source link

[Cost] AWS Fargate vs AWS Lambda same task.. #1

Open CrashLaker opened 1 year ago

CrashLaker commented 1 year ago

https://calculator.aws/#/addService/Fargate fargate: $10.53

Number of tasks or pods: 24 per day * (730 hours in a month / 24 hours in a day) = 730 per month
Average duration: 10 minutes = 0.17 hours
Pricing calculations
730 tasks x 1 vCPU x 0.17 hours x 0.0696 USD per hour = 8.64 USD for vCPU hours
730 tasks x 2.00 GB x 0.17 hours x 0.0076 USD per GB per hour = 1.89 USD for GB hours
20 GB - 20 GB (no additional charge) = 0.00 GB billable ephemeral storage per task
8.64 USD for vCPU hours + 1.89 USD for GB hours = 10.53 USD total
Fargate cost (monthly): 10.53 USD

image

vs lambda $0.24

Unit conversions
Amount of memory allocated: 2048 MB x 0.0009765625 GB in a MB = 2 GB
Amount of ephemeral storage allocated: 512 MB x 0.0009765625 GB in a MB = 0.5 GB
Pricing calculations
720 requests x 10,000 ms x 0.001 ms to sec conversion factor = 7,200.00 total compute (seconds)
2 GB x 7,200.00 seconds = 14,400.00 total compute (GB-s)
Tiered price for: 14400.00 GB-s
14400 GB-s x 0.0000166667 USD = 0.24 USD
Total tier cost = 0.2400 USD (monthly compute charges)
720 requests x 0.0000002 USD = 0.00 USD (monthly request charges)
0.50 GB - 0.5 GB (no additional charge) = 0.00 GB billable ephemeral storage per function
Lambda costs - Without Free Tier (monthly): 0.24 USD

image