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...?
Gaging AWS Lambda pricing for small application
SES + SQS + Lambda - Cost Effective?
-
SQS pricing: https://aws.amazon.com/sqs/pricing/
-
Lambda pricing: https://aws.amazon.com/lambda/pricing/
SQS: First 1 Million Requests/Month - Free
Lambda: $0.0000167 for every GB-second, $0.20 per 1M requests
Lambda w/1gb memory & 2 second duration = 1M invocations for $34. If you use 256mb memory on your lambdas then the cost is 1/4 that. Etc.
I'll leave the rest of math to you, since "quite frequently" isn't a number.
Why not just submit directly to SES unless? Less complexity and no known problems.
More on reddit.com