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...?

๐ŸŒ
Reddit
reddit.com โ€บ r/aws โ€บ lambda is the most expensive part of a project, is this normal? when to choose lambda / ec2.
r/aws on Reddit: Lambda is the most expensive part of a project, is this normal? When to choose lambda / Ec2.
September 3, 2023 -

Hello, pretty new to building on AWS so I pretty much just threw everything in lambda for the heavy compute and have light polling on EC2. I am doing all CPU and somewhat memory intensive work that lasts around 1-7 minutes on async lambda functions, which sends a webhook back to the polling bot (free t2 micro) when it is complete. For my entire project, lambda is accruing over 50% of the total costs which seems somewhat high as I have around 10 daily users on my service.

Perhaps it is better to wait it out and see how my SaaS stabilises as we are in a volite period as we enter the market, so it's kinda hard to forecast with any precision on our expected usage over the coming months.

Am I better off having an EC2 instance do all of the computation asynchronously or is it better to just keep it in lambda? Better can mean many things, but I mean long term economic scalability. I tried to read some economics on lambda/EC2 but it wasn't that clear and I still lack the intuition of when / when not to use lambda.

It will take some time to move everything onto an ec2 instance first of all, and then configure everything to run asynchronously and scale nicely, so I imagine the learning curve is harder, but it would be cheaper as a result? .

๐ŸŒ
Reddit
reddit.com โ€บ r/aws โ€บ is it worth using aws lambda with 23k call per month?
r/aws on Reddit: Is it worth using AWS lambda with 23k call per month?
February 13, 2024 -

Hello everyone! For a client I need to create an API endpoint that he will call as a SaaS.

The API is quite simple, it's just a sentiment endpoint on text messages to categorised which people are interested in a product and then callback. I think I'm going to use Amazon comprehend for that purpose, or apply some GPTs just to extract more informations like "negative but open to dialogue"...

We will receive around 23k call per month (~750-800 per day). I'm wondering if AWS lambda Is the right choice in terms of pricing, scalability in order to maximize the output and minimize our cost. Using an API gateway to dispatch the calls could be enough or it's better to use some sqs to increase scalability and performance? Will AWS lambda automatically handle for example 50-100 currency calls?

What's your opinion about it? Is it the right choice?

Thank you guys!

๐ŸŒ
Reddit
reddit.com โ€บ r/serverless โ€บ how much does my aws lambda cost per month?
r/serverless on Reddit: How much does my AWS Lambda cost per month?
June 23, 2018 -

AWS Lambda pricing is promising - you don't pay for idle, and you are billed for 100 milliseconds intervals. The pricing model is described thoroughly in this page, but honestly - do you really know what the cost of each function is?

There are too many parameters that you need to take into account when calculating the cost of each function, which turns out to be tough work. Also, what about monthly cost estimation?

  • Blog post: https://blog.epsagon.com/how-much-does-my-lambda-function-cost

  • Open source tool: https://github.com/epsagon/lambda-cost-calculator

๐ŸŒ
Reddit
reddit.com โ€บ r/aws โ€บ is it possible to monitor lambda costs by function? i have a huge increase in my costs and i'm unable to identify which function is causing that! thank you!
r/aws on Reddit: Is it possible to monitor lambda costs by function? I have a huge increase in my costs and I'm unable to identify which function is causing that! Thank you!
January 21, 2022 - Cost allocation tags is the best option but it will take 24h to propagate. If you want something quick you can go to AWS CloudWatch and check invocation metrics for functions, probably you will be able to see which one stands out.
๐ŸŒ
Reddit
reddit.com โ€บ r/aws โ€บ lambda cost optimization at scale: my journey (and what i learned)
r/aws on Reddit: Lambda Cost Optimization at Scale: My Journey (and what I learned)
March 31, 2025 -

Hey everyone, So, I wanted to share some hard-won lessons about optimizing Lambda function costs when you're dealing with a lot of invocations. We're talking millions per day. Initially, we just deployed our functions and didn't really think about the cost implications too much. Bad idea, obviously. The bill started creeping up, and suddenly, Lambda was a significant chunk of our AWS spend. First thing we tackled was memory allocation. It's tempting to just crank it up, but that's a surefire way to burn money. We used CloudWatch metrics (Duration, Invocations, Errors) to really dial in the minimum memory each function needed. This made a surprisingly big difference. y'know, we also found some functions were consistently timing out, and bumping up memory there actually reduced cost by letting them complete successfully. Next, we looked at function duration. Some functions were doing a lot of unnecessary work. We optimized code, reduced dependencies, and made sure we were only pulling in what we absolutely needed. For Python Lambdas, using layers helped a bunch to keep our deployment packages small, tbh. Also, cold starts were a pain, so we started experimenting with provisioned concurrency for our most critical functions. This added some cost, but the improved performance and reduced latency were worth it in our case. Another big win was analyzing our invocation patterns. We found that some functions were being invoked far more often than necessary due to inefficient event triggers. We tweaked our event sources (Kinesis, SQS, etc.) to batch records more effectively and reduce the overall number of invocations. Finally, we implemented better monitoring and alerting. CloudWatch alarms are your friend. We set up alerts for function duration, error rates, and overall cost. This helped us quickly identify and address any new performance or cost issues. Anyone else have similar experiences or tips to share? I'm always looking for new ideas!

๐ŸŒ
Reddit
reddit.com โ€บ r/aws โ€บ new lambda console dashboard - increased cost implications?
r/aws on Reddit: New Lambda console dashboard - increased cost implications?
October 17, 2024 - Just the START/END/REPORT lines generated by Lambda itself will cost $0.13/million invocations (almost the same as Lambda's $0.20/million invocation cost). If you have 5KB of log/console output (which is relatively low for a lot of functions), ...
Find elsewhere
๐ŸŒ
Reddit
reddit.com โ€บ r/aws โ€บ lambda vs ec2 costs for api
r/aws on Reddit: Lambda vs ec2 costs for API
January 16, 2023 -

Hi everyone I have a question regarding cost between lambda and ec2 I am building a simple node application using puppeteer that will only act as an api. Obviously donโ€™t expect heavy usage for now but overall Iv read that lambda will be cheaper to run up until heavy usage? Just wanted to get your thoughts if ec2 is better than lambda both in performance and cost. Again this will not be heavily used in either case. Also which ones performance will be better?

๐ŸŒ
Reddit
reddit.com โ€บ r/sre โ€บ aws lambda pricing model explained (including the hidden fees and fine print)
r/sre on Reddit: AWS Lambda pricing model explained (including the hidden fees and fine print)
September 25, 2021 -

Did you ever look at your Lambda bill thinking:

๐—ช๐—ต๐—ฎ๐˜ ๐˜๐—ต๐—ฒ ๐—ต๐—ฒ๐—น๐—น ๐—ฎ๐—ฟ๐—ฒ ๐—š๐—•-๐˜€๐—ฒ๐—ฐ๐—ผ๐—ป๐—ฑ๐˜€? ๐Ÿคจ

It doesn't sound initiative, but it's also not complex.

A breakdown including examples โ†“

๐—ฃ๐—ฟ๐—ฒ๐—ณ๐—ฎ๐—ฐ๐—ฒ

One of Lambda's major differences to services like EC2 or Fargate is the pay-per-use pricing: ๐˜†๐—ผ๐˜‚'๐—ฟ๐—ฒ ๐—ผ๐—ป๐—น๐˜† ๐—ฝ๐—ฎ๐˜†๐—ถ๐—ป๐—ด ๐˜„๐—ต๐—ฒ๐—ป ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ฐ๐—ผ๐—ฑ๐—ฒ ๐—ถ๐˜€ ๐—ฎ๐—ฐ๐˜๐˜‚๐—ฎ๐—น๐—น๐˜† ๐—ฒ๐˜…๐—ฒ๐—ฐ๐˜‚๐˜๐—ฒ๐—ฑ.

In detail, you're paying for GB-seconds.

Let's have a look into that:

There are several measures to take for #Lambda

โ€ข number of executions

โ€ข execution durations

โ€ข assigned memory to your Lambda functions

Calculation of the duration starts when the code inside your handler function is executed & stops when it returns or is terminated.

What's worth noting: global code (outside your handler) is executed at cold starts & ๐—ถ๐˜€๐—ป'๐˜ ๐—ฏ๐—ถ๐—น๐—น๐—ฒ๐—ฑ ๐—ณ๐—ผ๐—ฟ ๐˜๐—ต๐—ฒ ๐—ณ๐—ถ๐—ฟ๐˜€๐˜ ๐Ÿญ๐Ÿฌ ๐˜€๐—ฒ๐—ฐ๐—ผ๐—ป๐—ฑ๐˜€.

But back to the cost calculation with a look at AWS free tier.

For Lambda, it is ๐Ÿฐ๐Ÿฌ๐Ÿฌ,๐Ÿฌ๐Ÿฌ๐Ÿฌ ๐—š๐—•-๐˜€๐—ฒ๐—ฐ๐—ผ๐—ป๐—ฑ๐˜€ per month.

Breakdown: we're paying for ๐—ด๐—ถ๐—ด๐—ฎ๐—ฏ๐˜†๐˜๐—ฒ๐˜€ ๐—ผ๐—ณ ๐—บ๐—ฒ๐—บ๐—ผ๐—ฟ๐˜† assigned to your function ๐—ฝ๐—ฒ๐—ฟ ๐—ฟ๐˜‚๐—ป๐—ป๐—ถ๐—ป๐—ด ๐˜€๐—ฒ๐—ฐ๐—ผ๐—ป๐—ฑ.

For our free tier, this means: we got 400,000 seconds worth of a 1GB memory function.

This means more than 110 hours or 4 days!

If you change the memory assignment of your function, we'll get other numbers for the free tier:

โ€ข 128MB => ~880 hours / 36 days

โ€ข 256 MB => ~440 hours / 18 days

โ€ข 512MB => ~ 220 hours / 9 days

โ€ข 3072MB => ~37 hours / 1.5 days

As seen, calculations are not complex at all.

Let's have a look at a detailed example:

Running a function for ๐—ผ๐—ป๐—ฒ ๐˜€๐—ฒ๐—ฐ๐—ผ๐—ป๐—ฑ (๐Ÿญ๐Ÿฌ๐Ÿฌ๐Ÿฌ๐—บ๐˜€) with ๐Ÿญ๐Ÿฎ๐Ÿด๐— ๐—• for ๐—ผ๐—ป๐—ฒ ๐—บ๐—ถ๐—น๐—น๐—ถ๐—ผ๐—ป ๐˜๐—ถ๐—บ๐—ฒ๐˜€.

We're paying for:

โ€ข 1ms: $๐Ÿฌ.๐Ÿฌ๐Ÿฌ๐Ÿฌ๐Ÿฌ๐Ÿฌ๐Ÿฌ๐Ÿฌ๐Ÿฌ๐Ÿฎ๐Ÿญ

โ€ข 1s: $๐Ÿฌ.๐Ÿฌ๐Ÿฌ๐Ÿฌ๐Ÿฌ๐Ÿฌ๐Ÿฎ๐Ÿญ

=> 1m executions: $๐Ÿฎ.๐Ÿญ๐Ÿฌ

Is this included?

Yes, the free tier covers this completely.

We receive 400,000 GB-seconds.

That means:

=> 400,000 GB-seconds = ๐Ÿฏ,๐Ÿฎ๐Ÿฌ๐Ÿฌ,๐Ÿฌ๐Ÿฌ๐Ÿฌ 128MB-seconds

In our example, we're only using ๐Ÿญ,๐Ÿฌ๐Ÿฌ๐Ÿฌ,๐Ÿฌ๐Ÿฌ๐Ÿฌ 128MB-seconds! ๐Ÿคฉ

Let's switch from a 128MB to a 10GB function.

Now we end up with $๐Ÿฌ.๐Ÿฌ๐Ÿฌ๐Ÿฌ๐Ÿฌ๐Ÿฌ๐Ÿฌ๐Ÿญ๐Ÿฒ๐Ÿฒ๐Ÿณ per 10GB-ms.

Which means:

โ€ข 1s: $๐Ÿฌ.๐Ÿฌ๐Ÿฌ๐Ÿฌ๐Ÿญ๐Ÿฒ๐Ÿฒ๐Ÿณ

=> 1m executions: $๐Ÿญ๐Ÿฒ๐Ÿฒ,๐Ÿณ ๐Ÿคฏ ๐Ÿ”ฅ

Which are equal to 10,000,000 GB-secs!

So free tier doesn't do a lot here with its 400,000 GB-secs.

This calculation is an example.

Your function will execute computations way faster with those memory (& therefore vCPU) differences.

Also, there's a ๐—ฆ๐˜„๐—ฒ๐—ฒ๐˜ ๐—ฆ๐—ฝ๐—ผ๐˜ that we'll show you in this article: https://dashbird.io/blog/aws-lambda-cost-optimization-strategies/

๐˜…๐Ÿด๐Ÿฒ ๐˜ƒ๐˜€. ๐—”๐—ฅ๐— 

You can choose to run your Lambda's on different architectures.

Our examples were done for x86, but it's more expensive than on ARM/Graviton2!

โ€ข x86 Price: $0.0000166667 for every GB-second

โ€ข ARM Price: $0.0000133334 for every GB-second

See this article if you'd like to dive even deeper: https://dashbird.io/blog/aws-lambda-pricing-model-explained/

๐ŸŒ
Reddit
reddit.com โ€บ r/aws โ€บ cloudwatch and lambda costs are frustrating - does anybody have tips on lowering costs for a serverless environment?
r/aws on Reddit: CloudWatch and Lambda costs are frustrating - Does anybody have tips on lowering costs for a serverless environment?
September 1, 2023 - News, articles and tools covering Amazon Web Services (AWS), including S3, EC2, SQS, RDS, DynamoDB, IAM, CloudFormation, AWS-CDK, Route 53, CloudFront, Lambda, VPC, Cloudwatch, Glacier and more. ... For lambda make sure you don't set your memory usage too high or too low. Too low and your function might end up costing more due to longer runtimes.
๐ŸŒ
Reddit
reddit.com โ€บ r/aws โ€บ how we reduced lambda functions costs by thousands of dollars
r/aws on Reddit: How we reduced Lambda Functions costs by thousands of dollars
June 25, 2019 - Worker operations it is a solid use case and you should always batch your consumption so you're not billed with the warm up costs involved. more replies More replies More replies More replies More replies More replies ยท Why is everyone saying Lambda is more expensive than EC2? ... News, articles and tools covering Amazon Web Services (AWS), including S3, EC2, SQS, RDS, DynamoDB, IAM, CloudFormation, AWS-CDK, Route 53, CloudFront, Lambda, VPC, Cloudwatch, Glacier and more.
๐ŸŒ
Reddit
reddit.com โ€บ r/aws โ€บ aws lambda costs suddenly spiked โ€” anyone else seeing this?
r/aws on Reddit: AWS Lambda costs suddenly spiked โ€” anyone else seeing this?
August 29, 2025 -

On August 1st, AWS started charging for something that was previously free: the initialization phase of Lambdas.
Official blog post here: https://aws.amazon.com/blogs/compute/aws-lambda-standardizes-billing-for-init-phase/

Hereโ€™s the weird part: a few days before that change (around July 29th), we saw init times suddenly increase across multiple AWS accounts for one of our clients.

  • They went from ~500ms to 1โ€“3+ seconds

  • No deployments, no code changes, no new versions

  • Just noticeably slower inits out of nowhere

Now, when comparing billing, Lambda costs have more than doubled from July to August with no obvious reason.

Has anyone else noticed the same behavior? Is this just bad timing, or something more deliberate?

If youโ€™re running workloads on Lambdas, Iโ€™d recommend checking your metrics and costs. Would love to hear what others are seeing.

๐ŸŒ
Reddit
reddit.com โ€บ r/aws โ€บ pricing of lambda provisioned concurrency
r/aws on Reddit: Pricing of lambda provisioned concurrency
May 1, 2024 -

I was trying to setup provisioned concurrency in AWS lambda, and wanted some guidance on the cost overhead that I'll bear.

Let's say I decide to setup provisioned concurrency as 5.

My memory size 3072 MB.

Estimated total cost per month: $0.00000005 (cost per ms for 3072 mb) * 1000*60*60*24*30 (total ms in a month) * 5 (provisioned concurrency) = 648 $

A) is this calculation correct?

B) With every update do I have to deploy a new version and setup concurrency?

๐ŸŒ
Reddit
reddit.com โ€บ r/devops โ€บ how we reduced lambda functions costs by thousands of dollars
r/devops on Reddit: How we reduced Lambda Functions costs by thousands of dollars
March 3, 2019 -

An article I wrote explaining how we reduced our Lambda cost from 2200$ per day to 200$ per day: https://medium.com/foxintelligence-inside/how-we-reduced-lambda-functions-costs-by-thousands-of-dollars-8279b0a69931

Top answer
1 of 5
79
How I reduced S3 costs from 3k a month to 0.3k - cleaned up old shit (script took almost a week to complete, it was many many small files (we talking kilobytes), I saved my employer more than I get in a year, on my own initiative, did I get pay rise? Of course not, nobody gives a fuck about us...
2 of 5
44
Nice write-up! Serverless Computing or FaaS is the best way [for developers] to consume cloud compu[te resources]. It allowed us to [quickly push untested code to production]. We were serving +80M Lambda invocations per day across multiple AWS regions with an unpleasant surprise in the form of a significant bill. Wait wait wait. Hold the phone. You mean unbound scaling with no thought to how much it will cost is EXPENSIVE?! It was very easy and cheap to build a Lambda based applications that we forgot to estimate and optimize the Lambda costs earlier during development phase, Yea, sounds like what happens when you let developers run amok without an architect thinking about the big picture. Sure, features are great... but if you go out of business in your first month because you spent a years budget in AWS, those features are meaningless. To keep Lambda cost under control, understanding its behavior was critical. I feel like... the cart is WAY down the track and you're just thinking about which horse... I'm going to go out on a limb here and suggest that "FaaS" wasn't picked for any reason other than it's a new buzzword and instead of picking technologies for their technological merits, Lambda was chosen because it's the "new hotness". I mean, if you don't understand the technology your production application is running on... how can you reasonably expect to run it efficiently? I get it, "Lambda" and "FaaS" are all the new hotness. and we all want to use new and cool technologies. But, when all you have is a hammer, all you see is nails. I'm glad you achieved your goal, but I think a much better takeaway from this is that unbound and unplanned scaling is a good way to get yourself into trouble, fast. Anyway, nice write-up!
๐ŸŒ
Reddit
reddit.com โ€บ r/aws โ€บ aws announces lambda managed instances, adding multiconcurrency and no cold starts
r/aws on Reddit: AWS announces Lambda Managed Instances, adding multiconcurrency and no cold starts
3 weeks ago - First, you pay standard Lambda request charges of $0.20 per million invocations. Second, you pay standard ยท Amazon EC2 instance charges for the compute capacity provisioned. Your existing Amazon EC2 pricing agreements, including Compute Savings ...
๐ŸŒ
Reddit
reddit.com โ€บ r/aws โ€บ how expensive is it using lambdas for websocket endpoints?
r/aws on Reddit: How expensive is it using lambdas for websocket endpoints?
March 28, 2023 -

I'm working on an application which needs websockets.

Investigating this, it looks like it's possible to set up serverless websockets using API Gateway and Lambda - but I am wondering how expensive this gets.

Lambda is affordable when you are handling REST calls, but in that case you are only using milliseconds of CPU at a time. How does the pricing scale when using lambda for something more long running like a websocket server?

I.e. when my lambda is just waiting for the next WS callback, am I paying for it to be running?

Top answer
1 of 6
97
A lot depends on the size of the messages and whether you need to do one to many communications, as well as the value of those messages. For example in the past (before I worked at AWS) I worked for a social media company that was building the equivalent of the live chat in an Instagram live or Twitch chat: one to hundreds / thousands of people, and many very short messages being sent fast or spammed. I found this to be not price performant using a purely serverless model. The messages just don't have enough value to justify spending $1 per million, especially since that adds up very, very fast with one to many communication. Imagine that there are 1000 people watching the live chat. Every 1000 messages sent in the chat you are spending $1 because 1000 messages replicated out to 1000 recipients is 1 million messages sent. Now imagine the astronomical cost of live chat messages for a popular Twitch streamer or Instagram influencer who goes live with all their followers spamming chat for hours. There are ways to optimize this a bit like batching up the message and then pushing them out in 32kb chunks (the payload size for API Gateway WebSocket price metering), rather than actually sending the messages out immediately as they stream in. Or subdividing the live chat for a particularly large influencer into multiple smaller streams so that viewers only ever see a segment of the full chat stream. But this really hinders your ability to have realtime chat reactions. For something like a Twitch or IG live chat you really want to show those chat reactions ASAP, so storing up chat messages to dispatch in large chunks just feels bad. In my use case I instead went with a Fargate container hosting a websocket server myself. This Fargate container can handle thousands of connections at once with a single container and you can push thousands of messages per second off that one container. The economics of scaling it up work better for this particular workload. My scenario may not necessarily equal your scenario, but in my analysis if you have any type of fast moving chat with a one to many component you'll want to run your own persistent websocket server because otherwise costs will add up really fast. Of course the economics completely flip to the other side if you have a low volume workload with very few users and lots of periods where no one is using your application. But as you scale up it very quickly becomes clear that Lambda and API Gateway are an expensive way to do WebSockets
2 of 6
66
Api gateway handles the connection the lambda is only running when a message is sent. Itโ€™s honestly amazing. Iโ€™m using it for a an app with thousands of users connected 24/7 and my lambda bill is <$100
๐ŸŒ
Reddit
reddit.com โ€บ r/aws โ€บ aws lambda free tier
r/aws on Reddit: AWS Lambda Free Tier
March 28, 2024 -

I'm a bit confused about the Free Tier offering. I've read that AWS Lambda offers a Free Tier with 1 million requests per month and 400,000 GB-seconds of compute time per month, but I'm not sure if this only applies during the initial 12-month Free Tier term or if it's available indefinitely.

Can someone clarify if the AWS Lambda Free Tier is available beyond the first 12 months? And if so, are the 1 million requests and compute time limits still applicable?

๐ŸŒ
Reddit
reddit.com โ€บ r/aws โ€บ is serverless (aws lambda) the absolute cheapest option to run cloud native applications?
r/aws on Reddit: Is serverless (AWS Lambda) the absolute cheapest option to run cloud native applications?
April 29, 2022 -

Looking for the cheapest way to deploy a yet to be developed application.

It seems to me that Lambda functions behind the API Gateway is the cheapest and most scalable way to deploy a cloud native micro service. Am I wrong to assume this?

The other options from AWS like EC2 (replicate the original server environment), Beanstalk (traditional Java/Python web apps with slightly modified repackaging), ECS/EKS (Docker container image based) are more for backward compatibility with legacy/non cloud native apps and services that cannot/should not be changed.