For EC2 you can run more than 1 request at the same time. For lambda it is 1 lambda per request. If you have even a few concurrent requests you lambda cost can 5-10x noting all the cold start and other times too. Answer from re-thc on reddit.com
🌐
Reddit
reddit.com › r/aws › why is everyone saying lambda is more expensive than ec2?
r/aws on Reddit: Why is everyone saying Lambda is more expensive than EC2?
May 23, 2023 -

Please help me work out the math here, as I think I am doing this wrong.

A Lambda of 128mb costs $0.0000000021/ms, this works out $0.00756/hour.

A Lambda of 512mb costs $0.0000000083/ms, this works out $0.02988/hour.

Now if you look at EC2:

t4g.nano $0.0042/hour (0.5 GiB ram)

t4g.micro	$0.0084/hour (1GiB ram).

But... the Lambda will likely not run 100% of the time, and will stay warm for 10 minutes (not sure here?). And the RAM usage would be much better utilized if you got a function running, rather than an entire VPC.

Given all that, if the function can run with 128mb or less, it seems like a no-brainer to use Lambda.

However, if the function is bigger, it would only make sense to put it in an EC2 if it runs more than 30% of the time ($0.0084/hour cost of t4g.micro divided by 0.02988/h cost of 512mb lambda).

So why is everyone against Lambdas citing costs as the primary reason...?

🌐
Medium
medium.com › life-at-apollo-division › compare-the-cost-of-aws-lambda-fargate-and-ec2-for-your-workloads-ad112c4740fb
Compare The Cost of AWS Lambda, Fargate, and EC2 For Your Workloads | by Milan Gatyás | Life at ACTUM Digital | Medium
November 28, 2022 - EC2 pricing is indeed the lowest one, followed somewhat closely by Fargate, while Lambda pricing is about double of Fargate. EC2 pricing could be lowered further down by utilizing the T family burstable instance type, depending on the actual ...
Discussions

ECR or EFS cost for Lambda
while Lambda's pricing page says that data transfer with EFS and ECR are free, it does also mention it could incur costs in other services. EFS (Elastic throughput) has a read access cost of about $0.03, and ECR has a data transfer out cost of about $0.09 per GB. More on repost.aws
🌐 repost.aws
1
0
January 19, 2024
Why we moved from Lambda to ECS
It sounds like your use case could have been addressed by Step Functions - did you look into it before deciding to switch to ECS? More on reddit.com
🌐 r/devops
65
89
April 20, 2021
Is serverless (AWS Lambda) the absolute cheapest option to run cloud native applications?
There's no absolute, always answer. You have to calculate you expected load(s) and plug those into a cost calculator. That will at least get infra cost. Clearly they aren't the same to develop either. More on reddit.com
🌐 r/aws
25
15
April 29, 2022
Using Lambda vs EC2 for a backend
Lambda is much cheaper That isn't true. t3.nano is $0.0052/hour a lambda with the same memory (512 MB) is $0.000000834/ms or $0.05004/hour This makes the cost benefit obvious. If you can keep the server busy for > 6 minutes, an EC2 is cheaper by the hour. (and you can bill by the second with EC2 anyway) Thats a contrived, not red delicious to red delicious comparison, example, but I hope it is illustrative. when utilizing AWS API Gateway API Gateway is expensive once you exceed the free tier. Also, an EC2 has no cold start, and while I recognize cold starts aren't what they get made out to be sometimes, they are still a concern, especially for java solutions. (of course the ec2 has to be already running to not have a cold start, so I guess you could say the cold start on ec2 is way worse) More on reddit.com
🌐 r/aws
17
15
April 22, 2019
🌐
Amazon Web Services
aws.amazon.com › compute › aws lambda › pricing
AWS Lambda Pricing
2 weeks ago - Lambda Managed Instances enables you to run Lambda functions on fully-managed EC2 instances in your VPC, combining Lambda's serverless developer experience with the cost efficiency and hardware flexibility of EC2.
🌐
Sixfeetup
sixfeetup.com › blog › cost-to-run-aws-lambda-function-all-the-time
Lambda vs. Fargate: The Cost of Running 24/7
April 27, 2022 - AWS Lambda is expensive if you're using it for regularly occurring, long-running processes that do not to take advantage of the very short scaling time the service provides.
🌐
Sedai
sedai.io › home › blog › comparing aws lambda eks ecs ecs factors in system design and cost management
Lambda vs EKS vs ECS vs EC2: A Practical Comparison | Sedai
March 21, 2026 - EKS supports both EC2 instances ... control or prefer a fully managed, serverless infrastructure. ECS cost optimization requires more than scaling policies....
🌐
AWS
docs.aws.amazon.com › aws decision guides › aws decision guide › aws fargate or aws lambda?
AWS Fargate or AWS Lambda? - AWS Fargate or AWS Lambda?
Reduced operational overhead: Both Lambda and Fargate abstract away server management, reducing the need for patching, maintenance, and capacity planning. Pay-per-use pricing: You only pay for the compute resources you actually use, potentially lowering costs for variable workloads. Faster deployment: Typically offers quicker deployment times compared to provisioning and configuring EC2 ...
🌐
CloudZero
cloudzero.com › home › blog › ecs vs. ec2 vs. s3 vs. lambda: the ultimate aws comparison
ECS Vs. EC2 Vs. S3 Vs. Lambda: The Ultimate AWS Comparison
August 29, 2025 - If you switch on an EC2 instance, it runs until you shut down or terminate it. Lambda functions are off by default and are only activated when your setup is called upon (trigger) to serve a request (event). While AWS Lambda can be the more cost-effective option, reactivating Lambda functions every time may lead to latency issues, which EC2 instances do not present — unless you start a new container.
Find elsewhere
🌐
mkdev
mkdev.me › posts › processing-background-jobs-on-aws-lambda-vs-ecs-vs-ecs-fargate
AWS Background Jobs: Lambda vs ECS vs Fargate Cost Analysis
March 1, 2025 - 512Mb of memory gets as maximum 0.25 vCPU, meaning that 1ms would cost: (0.01425795+0.00156482)/(2*60*60*1000) = $0.000000002197607 · If we look at the per millisecond price, AWS Lambda is almost 4 times more expensive than ECS Fargate Spot.
🌐
Lumigo
lumigo.io › home › aws lambda vs ec2: compared on performance, cost, security, and more
AWS Lambda vs EC2: Compared on Performance, Cost, Security, and More - Lumigo
June 25, 2024 - Let’s take the second scenario where an application has a lot of hits, say 5 million per month, and each execution takes 200 ms with 1GB Memory. If we use Lambda, it will cost us $17.67. If we use EC2, t3.micro instances should be able to ...
🌐
Caylent
caylent.com › blog › cost-optimization-lambda
Cost Optimization: AWS Lambda | Caylent
It could be more beneficial from a business perspective to deploy capital into other business needs rather than allocating current funds toward future compute spend. This savings calculation is complicated even further by the fact that the savings plan will apply to EC2 first, then Fargate second, then Lambda last, because Lambda has the lowest discount rate.
🌐
Seft
seft.net
Lambda VS ECS – SEFT – Cloud Consulting Services
With Lambda: Your function is invoked, it runs for a few seconds or minutes, and then it shuts down. You pay only for those brief moments of execution. With ECS (EC2): You’d likely need to keep at least one EC2 instance running 24/7 or have a sophisticated auto-scaling setup that still might incur costs for spin-up time and minimum instances.
🌐
AWS re:Post
repost.aws › questions › QUwVEJrM0qQvKyy0RTC12SEA › ecr-or-efs-cost-for-lambda
ECR or EFS cost for Lambda | AWS re:Post
January 19, 2024 - while Lambda's pricing page says ... incur costs in other services. EFS (Elastic throughput) has a read access cost of about $0.03, and ECR has a data transfer out cost of about $0.09 per GB....
🌐
Sls
sls.guru › blog › serverless-showdown-fargate-vs-lambda
Serverless Showdown: Fargate vs. Lambda | Serverless Guru
May 3, 2021 - Regardless, you’ll still have to use ECS to register your containers since ECS manages Fargate, and this brings additional operational complexity. From all this, you’ll realize that your operational cost options are divided into several choices, including total operational ease via AWS Lambda, complete flexibility provided by EC2, and last but not least, compromising with Fargate.
🌐
Cloudairy
cloudairy.com › blog › fargate-vs-lambda
Fargate vs Lambda: Choosing the Right Compute Option
Lambda: For Lambda, you only pay for the number of requests and execution time. Since you are billed for compute time rounded to the nearest millisecond, this can be more cost effective for users with workloads that are event-driven or have ...
🌐
Dkpathak
blog.dkpathak.in › aws-lambda-vs-ecs
AWS Lambda vs ECS | DKProbes
Lambda manages, provisions, and secures EC2 instances for you, along with providing target groups, load balancing, and auto-scaling. It eliminates the complexity of managing EC2 instances. You want to pay only for capacity used. Lambda charges are metered by milliseconds used and the number of times your code is triggered. Costs are correlated to usage.
🌐
Site24x7
site24x7.com › learn › aws › aws-lambda-pricing-optimization.html
AWS Lambda Pricing & Cost Optimization: A Complete Guide - Site24x7
The amount of memory that is allocated to the Lambda function will be a deciding factor for the duration cost. For more detailed pricing according to the memory allocated, refer to this pricing guide. Note that the free-tier pricing is not applicable to Lambdas with Provisioned Concurrency enabled. If you have Provisioned Concurrency enabled, then prices would change as follows: Apart from the above, you may incur data transfer fees for Lambda. The pricing for these will be charged according to AWS EC2 data transfer rates.
🌐
Economize
blog.economize.cloud › home › aws › how much does aws fargate really cost? a simple breakdown
How Much Does AWS Fargate Really Cost? A Simple Breakdown
October 3, 2024 - While Lambda offers automatic scaling and resource management, Fargate provides more control over the runtime environment and is suitable for a broader range of applications. AWS Fargate offers a serverless solution for containerized applications, handling all infrastructure management, which makes it ideal for simple, automated scaling and cost-effective for variable workloads. Amazon ECS, however, provides more control and flexibility by allowing you to choose between Fargate’s serverless model or EC2 for custom infrastructure needs.
🌐
Binadox
binadox.com › home › blog › fargate vs lambda: which serverless option suits you?
Fargate vs Lambda: Which Serverless Option Suits You? - Binadox
September 4, 2025 - Lambda charges per request and compute time, making it cost-effective for sporadic workloads. Fargate bills by CPU and memory allocation, suiting consistent workloads better. ... Lambda has stricter limits on memory (up to 10GB) and runtime ...
🌐
Softweb Solutions
softwebsolutions.com › resources › aws-lambda-guide
Exploring AWS Lambda: Uses, Security, Performance and Cost
June 25, 2024 - This is particularly effective for applications with sporadic workloads, as Lambda only runs when needed, saving costs on idle server time. Business decision-makers benefit from cost efficiency and flexibility. IoT applications: In IoT ecosystems, Lambda can process data from connected devices ...