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
🌐
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 have to do to be cheaper than Lambda for that same workload? For comparison, we’ll use a typical workhorse 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
🌐
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 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 ...
🌐
Amazon Web Services
aws.amazon.com › compute › aws lambda › pricing
AWS Lambda Pricing
3 days ago - You configure your Lambda Managed ... Monthly request charges: 100M / 1M × $0.20 = $20 · Compute charges Instance type: m7g.xlarge EC2 on-demand price: $0.1632 per hour (US East N....
🌐
Mantel
mantelgroup.com.au › home › aws lambda vs. ecs vs. ec2: a comprehensive performance and cost analysis
AWS Lambda vs. ECS vs. EC2: A Comprehensive Performance and Cost Analysis | Mantel | Make things better
June 10, 2024 - The total cost of the test execution was $43.76 for Lambda scenario, $46.76 for ECS scenario and $45.73 for EC2 scenario with over 90% of the total cost were attributed to the use of S3, DynamoDb and API Gateway.
🌐
Medium
madurapperuma.medium.com › price-comparison-serverless-lambda-and-ec2-73187763c02d
Price Comparison Serverless Lambda, and EC2 | by gayan madurapperuma | Medium
December 26, 2023 - Cost Calculation for Lambda analyis without Free Tire · Let’s assume an application has 5000 hits per day with each execution taking 100 ms with 512MB, so the cost for the lambda function will be 0.16 USD ...
🌐
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.
🌐
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.
Find elsewhere
🌐
Cloudphilos
cloudphilos.io › post › how-much-more-expensive-is-aws-lambda
How Much More Expensive Is AWS Lambda? A Cost Comparison with EC2
When a Lambda function is invoked by API Gateway, it serves 1 request per function invocation. 1000 requests per second will invoke the function 1000 times every second. ... 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.
🌐
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...
🌐
CloudySave
cloudysave.com › aws › ec2 › aws-lambda-pricing-vs-ec2
AWS Lambda Pricing Vs. EC2 - CloudySave
March 31, 2021 - EC2 Instance Cost= $4.25. Hence, Lambda cost being $0.16 is merely 4% of the price of EC2 which is $4.25.
🌐
Dashbird
dashbird.io › home › aws lambda vs ec2: a comparative guide
AWS Lambda / EC2: Which Is Best? | Dashbird
July 25, 2023 - With Lambdas, you pay only for the compute time you consume – there is no charge when your code is not running. Use our Lambda cost calculator to estimate your costs. ... Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides ...
🌐
Stack Overflow
stackoverflow.com › questions › 56274163 › aws-ec2-vs-serverless-cost-comparison
amazon web services - AWS EC2 vs Serverless Cost Comparison - Stack Overflow
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. Especially if you have times where you have low or no use as lambda and ...
🌐
AWS re:Post
repost.aws › questions › QUnZW1en-xSH2F1-B_Y7toaQ › lambda-pricing-for-starting-and-stopping-ec2-instances
Lambda pricing for Starting and Stopping Ec2 instances | AWS re:Post
April 17, 2023 - https://calculator.aws/#/addService ,2. https://s3.amazonaws.com/lambda-tools/pricing-calculator.html ... Here is the cost estimation for Instance Scheduler.
🌐
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.
🌐
Lumigo
lumigo.io › guides › aws lambda 101 › aws lambda cost factors, cost comparisons and optimization [2024]
AWS Lambda Cost Factors, Cost Comparisons and Optimization [2024]
August 30, 2024 - Memory allocation can be configured, and costs are measured in 1 millisecond increments. For example, if your Lambda@Edge function has 128 MB of memory allocated, the duration charge will be $0.00000625125 for every 128 MB-second used. Amazon EC2 ...
🌐
Costgoat
costgoat.com › pricing › aws-lambda
AWS Lambda Pricing Calculator & Cost Guide (Dec 2025)
3 weeks ago - For a web API with 5M requests/month at 200ms duration: Lambda costs ~$4/month, while EC2 (t3.small) costs ~$15/month but can handle much higher traffic without additional cost.
🌐
Dzhuneyt's Blog
dzhuneyt.com › post › aws-lambda-vs-aws-ec2-cost
AWS Lambda vs AWS EC2 - Cost Comparison - Dzhuneyt
November 13, 2024 - BBVA (the second largest bank in Spain) has conducted a benchmark comparing both AWS services - AWS EC2 and AWS Lambda. The most interesting chart in my opinion is the following: It compares how are Lambda's costs increasing over the days of the month (the red line), compared to running an EC2 instance of various sizes (the other colored lines).
🌐
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....
🌐
Amazon Web Services
aws.amazon.com › compute › savings plans › compute and ec2 instance
Compute and EC2 Instance Savings Plans
3 days ago - Savings Plans are a flexible pricing ... Amazon EC2, AWS Lambda, and AWS Fargate usage, in exchange for a commitment to a consistent amount of usage (measured in $/hour) for a 1 or 3 year term. When you sign up for a Savings Plan, you will be charged the discounted Savings Plans price for your usage up to your commitment. AWS offers two types of Savings Plans: ... Compute Savings Plans provide the most flexibility and help to reduce your costs by up to 66%. ...