9 ms·
Can anyone using lambda at scale pitch in regarding costs? It seems companies are using it to build pipelines which could be much cheaper by writing full servic
by azth 5y ago
Can anyone using lambda at scale pitch in regarding costs? It seems companies are using it to build pipelines which could be much cheaper by writing full services as opposed to small functions that you pay for per invocation.
- cebert 5y agoI don’t work at a startup, but am working on a startup-like project where we are building a greenfield application that allows law enforcement officers to collaboratively edit reports such as accident reports. The entire API is built on Lambda, S3, and DynamoDB. The experience has been wonderful so far. We have a large dev team (~12-16 devs) working on the project and our dev account costs are only $100-250/mo. We even deploy each PR to the cloud to run automated tests against. Our production costs have been very manageable too. Lambda/serverless has been great for us. Our organization is relatively new to building SaaS cloud apps and doesn’t have the most mature devops practices (we’re growing there). Building this app on Lambda and DynamoDB and letting AWS help us with most of the scaling has really been a win for the team.
- ShakataGaNai 5y agoThey are fast to setup and require zero care and feeding. That's the big "time to market" cost. Beyond that, depends on your use case. I love using Lambda for webhooks that may be called anywhere from a few times a day to thousands of times per day. Once they get to the point of being "oh wow, this one lambda is expensive", you can clearly afford the budget to move it to a real server. But below that $20/mo mark (which is more than 5 million invocations of a small function) - you're golden.
- ijidak 5y agoMy lambda bill is $4,000 per month for 21,000,000 invocations per month. Something seems off compared to your numbers. Maybe the length of a single execution?
- theshrike79 5y agoLambda cost is invocation time * memory size pretty much. If your lambda bill is $4k a month, either your functions run multiple seconds each or you're using multiple gigs of memory.
- PetahNZ 5y agoWe trialed switching our EC2/ASG based queue worker over, price went up 10x-100x.
- wahnfrieden 5y agoI run mini monoliths on lambda functions, instead of tiny microservices. It's highly cost effective for unpredictable spiky traffic with high availability requirements. With Fargate, I have to run a bunch of unused overhead capacity just in case load spikes suddenly. Fargate scales up uselessly slowly to respond to sudden capacity needs without causing downtime.
- rmbyrro 5y agoDoesn't have a universal answer. Lambda doesn't charge for idle time or capacity, for example. Depending on your usage patterns and availability requirements, you may have a high cost in idle waste when using servers. But I think where Lambda really shines is removing time from infra setup, maintenance, etc. These are hidden costs and, even when accounted for, frequently underestimated. If you need even a part time DevOps or SRE engineer to make sure you'll keep things running smooth or will recover fast from a disaster, their salary alone already pays for shitloads of Lambda invocation and compute time.
- scrose 5y agoDon’t you need an SRE or Devops focused person regardless? You still need a way to test and deploy the code your pushing. You also need to set up logging and networking that ties it into the rest of your systems
- dlhavema 5y agoIt's kind of a nice to have but no you don't ""need "" that type of person to get started at least. I was the fourth engineer at a smallish currebtly Series A startup that used lambdas for ~90% of their services and we ( the software devs) built the CICD, API gateway integrations, all of that stuff. We figured out a good solution early and then maintained it. Which made moving forward pretty trivial. It only got a little bit more complicated as we wanted to use different authorization methods or VPC private link when we did eventually spin up a couple ECS clusters. The company now has a full-time DevOps/SRE, but they don't really work on the code deploy CI stuff. They more deal with I am audits and security and stuff...
- scrose 5y agoI definitely didn't mean to imply that you needed an SRE/Devops for starting off. The OP just came across as sounding like you don't need SRE/Devops in general if you use Serverless, which from my experience at multiple orgs just seems idealist. I'd argue that the need for someone focused on SRE/Devops comes from factors that are mostly unrelated to whether or not you go serverless.
- killingtime74 5y agoYou can always start with a lambda then move to its own service if costs justify. Develop as a Docker and there’s minimal if any conversion work
- renewiltord 5y agoIf you use the Go runtime, you can also trivially wrap in a Docker later and your iteration will be faster.
- scarface74 5y agoThere is absolutely no need to do that. You can run any standard MVC framework on Lambda using APIGW proxy integration and deploy the same code to Docker.
- renewiltord 5y agoOh I don't mean "switch to Go". I mean if you're already using Go, it's easier to use the Go runtime than the Docker runtime.
- itisit 5y agoIt’s best to do the math in advance, but not everyone is willing to put in the time required for a proper business case.
- discodave 5y agoI've never seen (healthy) fleets with average CPU utilization above 70-80%. That includes several-thousand machine fleets when I worked at Amazon. Most things I've seen in my career have 10-20% utilization at best. The Lambda "premium" over EC2 is only like 30-50%, so unless your workload is super consistent/predictable, and your code/hardware is well optimized, then Lambda will likely win on price. This is even more true now that you don't have to pay for API Gateway.
- buzzdenver 5y agoThis is relevant for CPU bound loads. Lots of lambdas do networking stuff where 90+% of the time is waiting for an HTTP download.
- recuter 5y agoI have. AdTech frequently runs close to 100%. Cryptomining style. I'm not sure I agree, why Lambda and not AWS spot instances? Or heaven forbid, one beefy server / office warmer. Lambda doesn't win on price it wins on flexibility.
- jjeaff 5y agoAs others have mentioned, one advantage is that lambda gives you the kind of uptime that would require at least 3 VMs spread across different AZs. But then, I have been running my SaaS on a single, rented beefy bare metal server in a data center with unmetered data and have had no more than 15 minutes of downtime per year for 3 years now.
- recuter 5y agoExactly, you've answered yourself. Also nothing prevents you from using multi zoned auto scaling group with a min/max of 1, you'll fail over to another AZ gracefully. You don't magically get 9 nines with lambda in practice either, trust me.
- recuter 5y agoWell enterprises that build pipelines often end up with Rube Goldberg type horrors regardless, and Lambda is more easy and fun to prototype with than say, Spark. If you know someone like that wait until they click around and find "step functions". There are more legit use cases. Lets say you are in charge of Eurovision. You spike from 0 to xxx,xxx of votes on an irregular basis during a few nights a year. You run an auction or ticket sales website of some sort. Your blog gets 3 clicks a month except for when you actually post something and it briefly gets noticed by HN.
- sofixa 5y agoFor blogs there's no need for "serverless" ( in the "classical" sense, FaaS/CaaS), static hosts exist, have an added security benefit and are very cheap, often with generous free tiers. They're also serverless in the sense that you don't need to manage servers, and can scale from 0 to millions in the blink of an eye. ( For reference, my blog costs me 0€/month, once going over the free tier of Firebase Hosting and costing me the grand total of 0.03€ in a month where it was twice on the HN front page, including briefly at #1).
- StratusBen 5y agoWe aren't a company that uses Lambda at scale but we have exposure to a few thousand AWS customers' cloud costs and I definitely say that the customers who are all-in using Lambda are saving a lot of money relative to their container/EC2 counterparts. That being said, I see very few companies "all in" on Lambda these days at an organizational level. It's still the exception - I think you need to be very intentional with its use at an organizational level architecture wise...but I see a lot of companies with sprinkles of Lambda usage here and there. Source/Disclosure: I am Co-Founder and CEO at https://www.vantage.sh/ https://www.vantage.sh/ - a cloud cost platform tracking in the hundreds of millions of dollars of annualized cloud spend.
- cameronh90 5y agoOff topic/feedback: I like the look of your service and it's something I've been thinking about looking into recently. I have even used the EC2 instance type list a ton without ever realising that it was attached to your site. However, I'm afraid that I sadly would not touch your service, because SSO is only on your enterprise plan. I hope that eventually you might consider putting SSO on one of the priced tiers. (https://sso.tax/ https://sso.tax/ approximates my opinion)
- yuppie_scum 5y agoLook into CloudZero. Great product, great service. Dunno bout cost.
- StratusBen 5y agoThanks for that feedback. I've mentioned this publicly before on HN: we are happy to offer anyone SAML SSO even if you fit into our Pro/Business tiers. We have configured "Enterprise" tiers for folks below $200/month and it is no sweat on our end. It just takes some pre-provisioning on our end that usually comes with more direct engagements with Enterprise customers. Anecdotally, typically _very_ few customers in the self-service tiers make mention of this. It's something we need to message better on our marketing site but for onlookers here, know the option is available to you.
- uuyi 5y agoRemember you don’t pay for invocations. You pay for memory, latency and traffic. That constrains how you build architectures with lambda. Anything bloated or written in low efficiency languages, or does any amount of compute or latent network traffic will burn you. That includes dealing with slow clients and synchronous APIs. As for rules, there aren’t really any catch-all ones. We build out on Kubernetes now though as that’s portable. The lambda developer story is quite horrible and that’s where our cost is.
- 015a 5y agoI'm fairly certain you do pay per invocation; $0.20/million. Its not the bulk of the cost for sure but its non-zero nonetheless.
- uuyi 5y agoYes that’s the point. The marketing points to that as the big cost but it’s insignificant compared to the real cost which is running workloads on it that aren’t optimised for price first. Which is probably most of them from experience. Then again that’s how Bezos rolls.
- ddoolin 5y agoIt all depends. Cost-wise, Lambda is the only real option for running tens of thousands of Monte Carlo-style simulations at once (which require high performance for a very short execution time). Containers are too slow to scale up for our target time, and if using regular instances, they'd need to be always-on which costs a ton for the performance tier we'd need. With Rust on Lambda we found a good mix of start time and parallelism of each that made it much cheaper and faster. EDIT: The workload times are only somewhat predictable so even doing something like scheduled scaling is a half-solution.
- semi-extrinsic 5y agoYou're doing whatnow?? This may come off as arrogant, but it sounds like something that could be rewritten in Fortran to run on an old laptop with similar execution time.
- derefr 5y agoI think they mean that they may need thousands of HPC cores for a few hundred milliseconds, and then zero cores right after; and (for some reason) absolutely cannot just do the work serially instead of in parallel.
- semi-extrinsic 5y agoYeah, I also interpret it that way, but I cannot understand what kind of system requires such a scheme. Even if the state space is non-ergodic, you should be able to get by with running your sampling on a dozen larger systems in some sense. Or just run on a workstation for a few months to precompute and tabulate the result for all possible inputs.
- ddoolin 4y agoI realize this was a week ago, but the parent comment is basically the case. The "some reason" is the expected time from request->response (which includes aggregation/interpretation of results) is 1-2 seconds with a sample size of ~50,000 for a pretty involved model that needs to be run on demand/in "real time" with no good, predictable time window. We can definitely get by running the sampling on a dozen larger systems, but those systems still cost more than (one thousand Lambda executions * a few hundred times a week max). Pre-computing is an interesting idea, but would certainly be an epic amount of work. The input set is also quite large (compiled motorsports data based on current state of an event). I'm also totally willing to admit I'm probably in over my head in designing such a system, but I did try a few different ways of architecting this and tweaking the parallelization in the source and this was the best cross of time/money I could get! It's definitely been a learning process for me; although I've got some years experience with scaling out, the system and requirements were much different than I've been exposed to. I'm sure this first take will be changed or at least refined once it's been in use for awhile.
- thamer 5y agoAn engineering blog from the BBC published an update a few days ago on their migration to a serverless architecture, titled "BBC Online – A year with serverless": https://medium.com/bbc-design-engineering/bbc-online-a-year-with-serverless-ffc2ae474277 https://medium.com/bbc-design-engineering/bbc-online-a-year-... They report 3.3B function invocations for 2.3B requests served, a total of 61,000 hours of execution time and 1,500 concurrent executions at peak. Using calculator.aws, simply entering the number of requests at 67ms each (61k hours/3.3B invocations) with 128 MB of memory each computes a cost of only $1,107. Then of course there's bandwidth, databases, file storage, and a lot more… but 3.3B lambda executions for $1.1k is really cheap. Not to mention that a client like the BBC would benefit from negotiated pricing with significant discounts. Even without discounts, serverless is often pretty cheap.
- ec109685 5y agoThat’s only averaging 72 request per second. Yes they, scale to 1,500 requests per second sometimes, which is an advantage of lambda, but we are talking about pretty small traffic. Still interesting though and glad it works for them.
- sofixa 5y agoAnd that's where serverless excels, highly variable loads.
- recuter 5y agoYou can certainly run a web server capable of 1,500 concurrent connections for under $100/mo. Run it on Linode or something, they'll throw in 10TB of bandwidth which probably covers it. Most of the serving is done by the CDN..
- renewiltord 5y agoRight, but once you're in the territory of "everything for $100" or "everything for $1000", they're both the same so you want the thing with the organizational efficiencies of independent deploys and permissioning, resilience and scaling, high availability etc.
- throwaway2016a 5y agoI use Lambda heavily, especially in new projects that haven't been proven yet. The cost savings are significant for two reasons: - Easier to maintain so less hours spent handling things like deployment and autoscaling. Payroll is likely the company's top expense so this is not insignificant. - If the traffic is sporadic or unpredictable you have 100% efficient resource utilization, which is very difficult with traditional servers. I have some microservices that would cost $10 per AZ / datacenter per month (so at least three to have High Availability) that cost effectively $0 per month on lambda. At scale, it depends on how consistent your load is. If it is highly consistent a server may make sense. But even for high traffic apps the cost can be lower or -- if it is higher -- so negligibly higher that the saved maintenance cost pays for it. I have many projects on Lambda, but for example: I run an entire small-startup of mine for < $1 per month and have high availability. The number of hours I would need to spend to get the cost that low would be way too expensive.
- paxys 5y ago> If the traffic is sporadic or unpredictable you have 100% efficient resource utilization, which is very difficult with traditional servers. Kinda. Amazon is the one getting 100% efficient resource utilization (or close to it). You will be billed based on what's on their rate chart, not utilization.
- htunnicliff 5y agoCare to share more about your small startup?
- throwaway2016a 5y agoWell, I'd love to share specifics but I've kept "throwaway2016a" anonymous for 6 years so gonna keep it that way :). But some general info: - API based product - Frontend using Next.js hosted on S3 behind CloudFront with some CloudFront Edge functions - Gets a few hundred thousand API calls a month - I wrote my non-edge Lambdas in Go. I found it to be much faster cold start times (about 100ms for me) and much faster runtime (< 10ms) than Node. The Edge functions are Node though because Edge on AWS only supports the Node.js runtime. - I use DynamoDB for my database. You get billed for what you use on Lambda and on average a single API call bills me for 8 - 12ms each. Plus the cost of API gateway. Actual response time is higher since SSL negotiation and API Gateway adds overhead but it's usually < 80 - 100ms which is within my SLA. But could scale up to a few million API calls a month without much added cost... about 20 - 30 million API calls per month before I hit the cost of the (minimum) 3 servers + load balancer I would need to do High Availability using servers.