6 ms·
3$ for 350k request is VERY expensive
by fabioyy 7y ago
3$ for 350k request is VERY expensive
- kenhwang 7y agoSeriously. Something like an AWS nano instance only costs $4/month and can easily handle that many requests an hour with a slow dynamic language.
- highfrequency 7y agoIs there no variable charge for network bandwidth?
- kenhwang 7y agoLambda and EC2 have the same network bandwidth charge.
- jerf 7y agoThe 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.
- tasogare 7y agoEspecially 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).
- habosa 7y agoHowever 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.
- cnst 7y agoIs 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.
- abc-xyz 7y agoPretty 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/ https://aws.amazon.com/api-gateway/pricing/)..
- nwsm 7y agoIf you meant for your comment to be constructive you'll need to expand on it.
- tuananh 7y agowell authhor did list high cost as disadvantage.
- paxys 7y agoIt may be very cheap or very expensive depending on what the requests are doing. There's no point making an overly generalized statement.
- jerven 7y agoMy experience with UniProt.org where some requests generate responses dynamically generated gigabytes in size. This is roughly 400x more expensive, assuming response equivalence.
- rumanator 7y ago>>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.
- SlowRobotAhead 7y agoAnd manage it yourself forever. I’m not saying this example isn’t expensive. But you didn’t post an apples to apples.
- rumanator 7y ago> 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.
- icebraining 7y agoNo, you can't get any Hetzner VM for $3/month.
- rumanator 7y ago> 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?
- lgsilver 7y agoAgree. 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.
- blantonl 7y agoCouple 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.
- shaneprrlt 7y agoAPI 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-beyond https://blog.heroku.com/scaling-ipify-to-30-billion-and-beyo...
- blantonl 7y agoI 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.
- 7y ago
- aeyes 7y agoIt 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.