3 ms·
Please see Pricing Example 1 on https://aws.amazon.com/lambda/pricing/ https://aws.amazon.com/lambda/pricing/. That's Amazon's own pricing example using typical
by jamiesonbecker 10y ago
Please see Pricing Example 1 on https://aws.amazon.com/lambda/pricing/ https://aws.amazon.com/lambda/pricing/. That's Amazon's own pricing example using typical values.
30.5 is the average number of days in a month. (365/12)
86,400 is the number of seconds in a day.
So, in other words, based on the very example shown on the Lambda pricing page, 3 million requests in a month is only 1.14 per second.
A single bare-bones t2.nano instance can easily handle that, but let's pretend that it's very, very spikey... so you need 10 nano's. (Of course, let's also pretend that you're constantly using them all, and autoscaling doesn't exist.) A nano can probably easily handle 100 req/s in even the slowest API framework (and certainly the languages supported by lambda), so that's where the rest of the numbers came from.
So, in other words, a cluster that easily handles 1,000 req/s would cost around $67/month, vs $1,600 and change for Lambda. Their very own example proves that it's far from cheap.
The worst part is that as scale increases, the cost disparity increases linearly. Recipe for disaster.
But, again, it's very useful for small things. (AWS certified Solutions Architect and I don't really touch lambda except for things that aren't worth running a whole server for.)
- RubenSandwich 10y agoMakes sense. Thanks for explaining. For scaling a lambda it might make sense to run your lambdas on EC2 using this: https://github.com/lambci/docker-lambda https://github.com/lambci/docker-lambda. (But at that point you loose the 'NoOps' benefit of lambda and I can't imagine you'd get similar performance to just running a Node Server or the like.)
- jamiesonbecker 10y agoThis looks cool! thanks for pointing it out!