logoalt Hacker News

themafiayesterday at 5:23 AM1 replyview on HN

> “This EC2 instance type running 24/7 at full load is way less expensive than a Lambda running”.

For the same amount of memory they should cost _nearly_ identical. Run the numbers. They're not significantly different services. Aside from this you do NOT pay for IPv4 when using Lambda, you do on EC2, and so Lambda is almost always less expensive.


Replies

nijaveyesterday at 11:44 AM

I'm curious how that plays out when you factor in other infrastructure components like DB and load balancers.

On Lambda, load balancing is handled out of the box but you may need to introduce things like connection poolers for the DB you could have gotten away without on EC2

Think it also depends if you're CPU or memory constrained. Lambda seemed more expensive for CPU heavy workloads since you're stuck with certain CPU:mem ratios and there's more flexibility on EC2 instance types

show 1 reply