News for hackers. Stuff that matters.
Re:Handling 350k Requests for $3 using Lambda by fabioyy on Friday February 28, 2020 @02:01PM (#22445327)
3$ for 350k request is VERY expensive
Re:Handling 350k Requests for $3 using Lambda by blantonl on Friday February 28, 2020 @02:52PM (#22445753)
Couple points here in this specific case

1) Lambda costs were shown as actually 50 cents for all this. 2) API Gateway was the balance of the cost, and actually isn't needed in this customer's use case. Lambdas can be placed behind application load balancers which are significantly less expensive.

Author also mentions other downsides such as "vendor lock-in," however his lambdas were written in NodeJs and it would be trivial to move his code to some other NodeJs delivery mechanism such as Fargate or ECS cluster.

The benefit here is his deployment with the ServerLess framework got him his MVP very quickly on a very scalable environment with minimal management.

Re:Handling 350k Requests for $3 using Lambda by shaneprrlt on Friday February 28, 2020 @03:37PM (#22446107)
API Gateway is the definite gotcha with serverless architectures. Whenever someone tells me how cheaper serverless is, I figure they haven't actually dived in to see how many AWS resources besides Lambda are required for a production deployment.

It is convenient in several use cases, but for an endpoint or even an entire API that is going to receive a lot of load, managing servers is the more economical approach.

If you need to get a one-off endpoint built that won't receive any significant amount of load, I think a serverless solution is great. But I wouldn't use it as my primary API architecture. Like most things in tech, there's no silver bullet. Context matters, and the best approach depends on many factors.

I still recall this article by the creator of ipify on how he's able to receive upwards of 30 billion requests per month on Heroku for a fraction of the cost of API gateway: https://blog.heroku.com/scaling-ipify-to-30-billion-and-beyo...

Re:Handling 350k Requests for $3 using Lambda by blantonl on Friday February 28, 2020 @05:22PM (#22446962)
I run 8 different production API endpoints, all on Lambda, directly through Application Load Balancer instead of API Gateway, and they served 510 million requests last month for about $200.

Those API endpoints took me about a day to deploy using serverless deployment tools. They economically scale between extremely varied workload requirements. There are no complaints on my end.

Re:Handling 350k Requests for $3 using Lambda by rumanator on Friday February 28, 2020 @06:56PM (#22447550)
> and they served 510 million requests last month for about $200.

In EC2, which is not cheap at all, that's between the monthly cost of one m2.2xlarge and m3.2xlarge instance, or two m2.xlarge instances, or 3 t3.large, or 7 t3.medium.

In other words, you can operae a small cluster on AWS for that price tag.

Re:Handling 350k Requests for $3 using Lambda by guitarbill on Saturday February 29, 2020 @01:24PM (#22452034)
I don't know how I'm only hearing about this now, since it's been available since late 2018, but that sounds awesome - unlike API Gateway, which is a horrible, buggy mess that doesn't work well for anyone I've spoken to.
Re:Handling 350k Requests for $3 using Lambda by koolba on Friday February 28, 2020 @03:46PM (#22446201)
> Author also mentions other downsides such as "vendor lock-in," however his lambdas were written in NodeJs and it would be trivial to move his code to some other NodeJs delivery mechanism such as Fargate or ECS cluster.

I find it amusing that your examples to which one could move the project and avoid “vendor lock-in” are both from the same vendor as Lambda.

I get the point that it’s not Lambda specific outside the entry point, it’s just funny that the presented alternatives are still cutting a check to the same vendor.

Re:Handling 350k Requests for $3 using Lambda by blantonl on Friday February 28, 2020 @05:23PM (#22446972)
Well, the variability in this case is how much system administration you want to do. Right?
Re:Handling 350k Requests for $3 using Lambda by ldoughty on Friday February 28, 2020 @06:58PM (#22447560)
Application load balancing is VERY expensive compared to other solutions on the low end. Minimum ALB price is $16/month.

The trade off with API Gateway is around 5 million requests (I wrote an article on it: https://ldoughty.com/2019/12/comparing-aws-api-gateway-to-lo... )

ALB is probably the best solution > 5-6 million and up.. or perhaps HTTP API Gateway between 5-6 and 15 million... But it needs to be near 20 million requests/month before ALB is the "best" solution (though there are still some other considerations that might factor in if your involving a lot of AWS Data transfer which is waived when you are not binding to a VPC, which ALB requires)

Re:Handling 350k Requests for $3 using Lambda by kenhwang on Friday February 28, 2020 @02:05PM (#22445353)
Seriously. Something like an AWS nano instance only costs $4/month and can easily handle that many requests an hour with a slow dynamic language.
Re:Handling 350k Requests for $3 using Lambda by jerf on Friday February 28, 2020 @02:13PM (#22445416)
The scary thing I saw is that while it's cool that Lambda is $2/month right now, which is negligible, it's $2/month for 900 users. If it scales linearly (and I don't know that it does, because I don't know exactly how the system works), then that means you're one good blog post somewhere about your extension away from being $200-$2000/month.

That said, my gut says there's a good chance that since the author is surprised at the rate of requests, there's almost certainly an optimization opportunity that wouldn't even take much effort.

Re:Handling 350k Requests for $3 using Lambda by tasogare on Friday February 28, 2020 @02:22PM (#22445505)
Especially the author has experience with docker so deploying a container for his app on Digital Ocean would be super quick and easy. In addition, the list of disadvantages seems longer than the advantages, with scary points like the difficulty to debug things (that could easily takes hours to figure out if something don’t run properly).
Re:Handling 350k Requests for $3 using Lambda by habosa on Friday February 28, 2020 @02:27PM (#22445552)
However in the case when they both get 0 requests, the Lambda solution costs $0 and the Micro instance still costs $4.

That's a really nice advantage for starting a new project where you're confident in unit economics but have unknown scale.

Re:Handling 350k Requests for $3 using Lambda by cnst on Friday February 28, 2020 @03:35PM (#22446088)
Is it two different arguments you're posting? How's $0 on zero requests is a better solution when the range would be 0 to $2000 for what's a fixed $4 without Lambda?

The $0 argument is also flowed because $4 is a fixed cost for unlimited $0 to $2000 solutions through hedging. If you have 10 solutions, what's the likelihood of all of them still doing $0, or at the very least below $4?

The unit economics argument is likewise hard to see in practice, because we'd be talking quite different numbers on a per-unit cost with Lambda vs. without, which may easily make the difference between making a profit or taking a loss, especially if it's a lifestyle business we're talking about.

Re:Handling 350k Requests for $3 using Lambda by abc-xyz on Friday February 28, 2020 @04:46PM (#22446723)
Pretty sure you'd have to pay at least $3.5 if you wanted to expose your Lambda function using AWS API Gateway (which I assume most would want to do).. The author mention $1.11 but that's for "HTTP APIs (Preview)" rather than "REST APIs" - in either case it wouldn't be 0. At least that's how I read it.. AWS pricing is such a mess with so many hidden fees (https://aws.amazon.com/api-gateway/pricing/)..
Re:Handling 350k Requests for $3 using Lambda by highfrequency on Friday February 28, 2020 @02:11PM (#22445405)
Is there no variable charge for network bandwidth?
Re:Handling 350k Requests for $3 using Lambda by kenhwang on Friday February 28, 2020 @03:00PM (#22445801)
Lambda and EC2 have the same network bandwidth charge.
Re:Handling 350k Requests for $3 using Lambda by paxys on Friday February 28, 2020 @02:15PM (#22445431)
It may be very cheap or very expensive depending on what the requests are doing. There's no point making an overly generalized statement.
Re:Handling 350k Requests for $3 using Lambda by rumanator on Friday February 28, 2020 @03:06PM (#22445858)
>>It may be very cheap or very expensive

It is very expensive. Very. No need to ignore this fact. You can get a VM with 2 vCPU and 2GB of RAM for that amount with some cloud service providers like Hetzner.

Re:Handling 350k Requests for $3 using Lambda by SlowRobotAhead on Friday February 28, 2020 @04:25PM (#22446512)
And manage it yourself forever.

I’m not saying this example isn’t expensive. But you didn’t post an apples to apples.

Re:Handling 350k Requests for $3 using Lambda by rumanator on Friday February 28, 2020 @06:19PM (#22447339)
> And manage it yourself forever.

We're not in 1990 anymore. Nowadays all deployments are automatic and ephemeral. I have multiple services up and running with zero downtime for close to a year in a single VM instance that I haven't intervened directly since I launched it, and during that time I lost track of how much time I had to spend fiddling with AWS lambdas and AWS API Gateways.

Re:Handling 350k Requests for $3 using Lambda by icebraining on Friday February 28, 2020 @06:33PM (#22447422)
No, you can't get any Hetzner VM for $3/month.
Re:Handling 350k Requests for $3 using Lambda by AC_Fan on Friday February 28, 2020 @09:01PM (#22448201)
The CX11 is 2.49 euro without tax, which is 2.75 USD right now.
Re:Handling 350k Requests for $3 using Lambda by rumanator on Friday February 28, 2020 @06:59PM (#22447565)
> No, you can't get any Hetzner VM for $3/month.

So Hetzner's CX11 instances, that go for €3.01/month with unlimited bandwidth, don't exist in your world?

Re:Handling 350k Requests for $3 using Lambda by icebraining on Friday February 28, 2020 @07:14PM (#22447632)
That's more than $3. Sure you get unlimited bandwidth and other stuff, but if you don't need it, why waste more money?
Re:Handling 350k Requests for $3 using Lambda by jerven on Friday February 28, 2020 @03:03PM (#22445834)
My experience with UniProt.org where some requests generate responses dynamically generated gigabytes in size. This is roughly 400x more expensive, assuming response equivalence.
Re:Handling 350k Requests for $3 using Lambda by lgsilver on Friday February 28, 2020 @02:19PM (#22445479)
Agree. We consider non-cached requests costly if they extend beyond around $1.50 / million. That said, we do about 2-3% of requests non-cached. As a content network, that means that a million web requests can be as low as $.30 to .40. This does have a lot of benefit to scale, but ~$10 / million seems high. What stops you from putting a ttl on these and caching them for a couple mins. Probably would lower that number substantially.
Re:Handling 350k Requests for $3 using Lambda by aeyes on Friday February 28, 2020 @03:18PM (#22445937)
It would be a fraction of that without API gateway, not sure what it is needed for. I deploy directly to Lambda@Edge and it is an order of magnitude cheaper.
Re:Handling 350k Requests for $3 using Lambda by tuananh on Friday February 28, 2020 @02:09PM (#22445393)
well authhor did list high cost as disadvantage.
Re:Handling 350k Requests for $3 using Lambda by nwsm on Friday February 28, 2020 @02:07PM (#22445372)
If you meant for your comment to be constructive you'll need to expand on it.