Besides what others commented about concurrent reqs in EC2 vs independent lambda execution costs, the trick considering all that is that Lambda is more efficient in terms of costs than EC2 UP UNTIL a certain amount of reqs/s, from that threshold onwards, the appropriate EC2 instance is cheaper. Engineers at BBVA came to this conclusion and wrote the whole analysis they made: https://www.bbva.com/en/innovation/economics-of-serverless/ Answer from HarrityRandall 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...?

🌐
Trek10
trek10.com › homepage › blog listing › aws lambda pricing in context - a comparison to ec2
AWS Lambda vs EC2 Cost Comparison - Trek10 | Trek10
How much compute would your EC2 ... instance, the m4.large instance type. It has 2 vCPU and 8 GB RAM and costs $0.12/hr or approx $86/month in the N....
Price   $
Address   1400 E. Angela Blvd, Suite 209, 46617, South Bend
Discussions

AWS Lambda provisioned concurrency vs EC2 – SQLServerCentral Forums
If the apps/scripts you are running are under 10 minutes execution then AWS Lambdas would be ideal. I mean, anything really short duration shouldn't be on an EC2 unless there is a security feature you cannot get with AWS Lambda that you need with an EC2. The idea of running VM's is a huge cost, ... More on sqlservercentral.com
🌐 sqlservercentral.com
May 5, 2022
amazon web services - AWS EC2 vs Serverless Cost Comparison - Stack Overflow
Now I want to convert the EC2 server to the Serverless Platform i.e(API Gateway and Lambda). I have also followed different blogs and I am ready to go with the serverless. But, my one concern is on pricing. How can I predict per month cost for the serverless according to my use of EC2? More on stackoverflow.com
🌐 stackoverflow.com
Why is Lambda considered more expensive than EC2 for serverless computing? - LambdaTest Community
For example, a 128MB Lambda costs $0.00756/hour, while a t4g.nano EC2 instance (with 0.5GB RAM) costs $0.0042/hour. I’m considering using Lambda, but I’m not sure where the cost concerns come in. If a Lambda doesn’t run 100% of the time, and assuming it stays warm for 10 minutes, shouldn’t ... More on community.lambdatest.com
🌐 community.lambdatest.com
0
June 2, 2025
Lambda vs ec2 costs for API
Much of my work involves companies frantically scrambling to get off of ec2’s into serverless because the cost of maintaining ec2 makes little sense if their system is event driven. I would start serverless and only add an ec2 if there’s literally no other service that can help you. More on reddit.com
🌐 r/aws
43
13
January 17, 2023
🌐
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 Apollo Division | 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 ...
🌐
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 assume an application has 5,000 hits per day with each execution taking 100 ms with 512MB. So the cost for the Lambda function will be $0.16. To get the same hardware resources, you can use a t2.nano EC2 instance.
🌐
SQLServerCentral
sqlservercentral.com › forums › topic › aws-lambda-provisioned-concurrency-vs-ec2
AWS Lambda provisioned concurrency vs EC2 – SQLServerCentral Forums
May 5, 2022 - If the apps/scripts you are running are under 10 minutes execution then AWS Lambdas would be ideal. I mean, anything really short duration shouldn't be on an EC2 unless there is a security feature you cannot get with AWS Lambda that you need with an EC2. The idea of running VM's is a huge cost, both in time and money.
🌐
Amazon Web Services
aws.amazon.com › compute › aws lambda › pricing
AWS Lambda Pricing
1 day ago - You configure your Lambda Managed ... request charges: 100M / 1M × $0.20 = $20 · Compute charges Instance type: m7g.xlarge EC2 on-demand price: $0.1632 per hour (US East N....
Find elsewhere
🌐
Medium
medium.com › @moradiyabhavik › aws-compute-services-lambda-vs-ec2-vs-ecs-choosing-the-most-cost-effective-and-highly-available-1cfb410aff1f
AWS Compute Services: Lambda vs EC2 vs ECS — Choosing the Most Cost-Effective and Highly Available Solution | by Bhavik Moradiya | Medium
June 13, 2024 - Choosing between AWS Lambda, Amazon EC2, and Amazon ECS depends on your specific application requirements, traffic patterns, and operational preferences: AWS Lambda is ideal for event-driven, variable workloads where you want minimal operational overhead and cost-efficiency for intermittent usage.
🌐
Quora
quora.com › Which-is-more-cost-efficient-in-AWS-for-Web-Applications-EC2-Instances-or-Lambda-and-other-services
Which is more cost efficient in AWS for Web Applications, EC2 Instances or Lambda and other services? - Quora
Answer (1 of 30): This usually depends on your execution times and how much memory your process consumes per invocation. If you have a large memory footprint and a long-running process, you are usually better off using EC2-based services, including AWS Batch. Always compare your options when pic...
🌐
TechTarget
techtarget.com › searchcloudcomputing › tip › An-overview-of-Amazon-EC2-vs-AWS-Lambda
An overview of Amazon EC2 vs. AWS Lambda | TechTarget
Unlike EC2, Lambda charges only for active compute time and the number of requests made. The cost of Lambda compute time represents measurable work from the service -- execution to termination.
🌐
CBT Nuggets
cbtnuggets.com › blog › certifications › cloud › aws-lambda-vs-ec2-which-to-use-and-when
AWS Lambda vs EC2: Which to Use and When
September 14, 2020 - Lambda charges the customer per request and duration. EC2, on the other hand, charges the customer for every second the instance is running.
🌐
Dzhuneyt's Blog
dzhuneyt.com › post › aws-lambda-vs-aws-ec2-cost
AWS Lambda vs AWS EC2 - Cost Comparison - Dzhuneyt
November 13, 2024 - You probably noticed that all three of the EC2 instances have a linear pricing growth, because their hourly price is fixed and not bound to the number of requests. The red line is the Lambda costs.
🌐
Stack Overflow
stackoverflow.com › questions › 56274163 › aws-ec2-vs-serverless-cost-comparison
amazon web services - AWS EC2 vs Serverless Cost Comparison - Stack Overflow
So you pay for the compute that is used. This is different to ec2 as ec2 pricing is based on hours ran. So it could be a big savings to go with serverless, but that all depends on the workload you are doing.
🌐
Serverless Team
serverless.direct › post › aws-lambda-vs-ec2-which-one-to-choose-for-your-app
AWS Lambda vs. EC2: Which One to Choose for Your App
September 25, 2023 - Since you're only charged when your functions execute, you can avoid the ongoing expenses associated with continuously running servers. Additionally, Lambda's automatic scaling ensures that you don't over-provision resources, further optimizing costs. ... Amazon EC2 offers more flexibility in terms of pricing, with various instance types and pricing options.
🌐
Cloudphilos
cloudphilos.io › post › how-much-more-expensive-is-aws-lambda
How Much More Expensive Is AWS Lambda? A Cost Comparison with EC2
... If the average function execution time is 4ms processing and 200 ms waiting, you’re being billed for the full 204 ms. 1000 times per second. This means total costs rise linearly as execution time increases. ... With EC2, it doesn’t.
🌐
Substack
urielbitton.substack.com › p › lambda-vs-ec2-which-compute-service
Lambda Vs EC2: Which Compute Service Is Cheaper?
December 16, 2024 - Total duration = 3 million * 150 ... = $ 0.6 ... Clearly, in this scenario, of relatively low usage, Lambda offers a much cheaper service compared to EC2....
🌐
Hacker News
news.ycombinator.com › item
AWS Lambda is cool and all, but aren't people doing the math on this? Lambda see... | Hacker News
July 12, 2016 - Am I missing something · Don't compare the cost of Lambda per 100ms to the cost of a virtual machine per month since Lambda only charges as you use it. You'd have to have the CPU pegged at 100% usage to make that a fair comparison. Mind you even if you took the cost of Lambda per 100ms and ...
🌐
LambdaTest Community
community.lambdatest.com › general discussions
Why is Lambda considered more expensive than EC2 for serverless computing? - LambdaTest Community
June 2, 2025 - For example, a 128MB Lambda costs $0.00756/hour, while a t4g.nano EC2 instance (with 0.5GB RAM) costs $0.0042/hour. I’m considering using Lambda, but I’m not sure where the cost concerns come in.
🌐
Sedai
sedai.io › 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
Spot Instances: Discounted pricing ... a t3.micro instance costs around $0.0104 per hour on-demand, whereas larger instances like the m5.2xlarge can cost around $0.384 per hour.In addition to compute costs, remember to factor in additional services such as Elastic Load Balancing (ELB), which can add costs if your EC2 instances need to handle high levels of traffic.EC2 can be the most cost-effective for long-running, predictable workloads, especially when using reserved instances, but it can quickly become expensive for short-lived tasks or fluctuating demand...
🌐
AWS
calculator.aws
AWS Pricing Calculator
AWS Pricing Calculator lets you explore AWS services, and create an estimate for the cost of your use cases on AWS.