by VWWHFSfQ · 6y ago · 0 comments
I tried Lambda for a use-case that I had in 2018:
We published Polls and Predictions to people watching the 2018 World Cup. We set the vote callback URL to a function on AWS Lambda.
It failed spectacularly during our load-testing because the ramp-up period was far too slow. We needed to go from 0 to 100,000 incoming requests/second in about 20 seconds.
We had to switch to an Nginx/Lua/Redis endpoint because Lambda was just completely unusable. It would have cost us $27,000/month to pre-provision 10,000 concurrent executions...
What is it that people actually use Lambda for?
For us the perfect use case is the production of PDF reports: they aren't run that often; they can be emailed a few minutes later; and when too many of them are run at the same time, they would steal all the RAM on the server.
The perfect use case we see repeatedly is for high volume HTTP requests to API Gateway endpoints that trigger Lambda functions that respond in less than a second depending on what compute is running.
Running Lambda as a back-end is one of the most expensive options (especially when high load comes in, as a parent pointed out). So no question, that's what they want to sell.
It is a very common pattern for IoT applications also and well-suited for it. The workloads are often bursty and unpredictable.
But for many things, I believe it is still preferable to stick with a traditional web app or API. It is still early days for serverless and there is a lot of hype around it. As with most hyped things, people see it as a silver bullet and don't think through the tradeoffs they are making.
From direct exposition (via API gateway) to HTTP traffic, to very spiky loads such that we don't pay for hardware in between spikes. We've also have a kind of "hybrid pipeline" that is a mix of both HTTP requests from clients and SQS messages. The HTTP part sends messages to SQS, which triggers lambdas asynchronously so we get retries for free.
Your load doesn't strike me as being out of the ordinary, I suspect you had one of the following: - Slow start, which means AWS was unable to re-use an already warm container to run the function a second start. This is particularly true with Java, although they've massively improved it recently. - A dependency on another service which would have caused the slow start (loading a config is a common unexpected culprit) - You mention 2018, so at that time running a lambda within a VPC was notoriously slow to start - You had a limit on your AWS account (default is 1k concurrent I believe)
There are very many users of Lambda that run very high volume production workloads (billions of requests a month) and save an enormous amount of money doing so compared to traditional techniques. A lot of that saving comes from the ability to create solutions in days as opposed to weeks or even months and the fact that for most use cases the capacity exists to handle the volume most users need.
https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/S...
Edit 5 months cos it went live in jan.
Of course, in this case I have to use it, because Firebase Hosting is static, so this is the only way to handle dynamic urls if the simple rules of firebase.json are not enough.
1) AWS administration-related actions (required for non-trivial mgmt.)
2) end-user actions (optional).
AWS throttles and limits everything, so expecting 100,000 requests in 20 seconds on a default AWS account is unreasonable.
The Cloud doesn't mean unlimited capacity.
Also, I haven't seen anybody version control lambda code, even in compliance environments, so something to investigate.
What ? That does not make any sense to me. I know I do and I think many do too.
We have anything that gets deployed to lambda go through a jenkins job. Pulls code from GH and builds/uploads it to lambda. Very few people have the ability to manually edit lambda jobs through AWS. While it isn't a perfect solution, it's worked pretty well for us.
Huh, how is it any different building and deploying to anything else.
I store the code in git, build it in team city, and deploy it to S3 using octopus deploy which updates the lambda to point to the new versioned off zip.
I've built a lot of lambda apps and never used it, pretty much everything I do requires dependencies.
Sure, I used a lambda to turn on/off a build server during particular hours. I wrote it directly into the console.
For actual applications tho, I don't use the console.
Just because the console exists doesn't mean people are flat out not versioning their code.
Edit: my AWS support rep explained it: Without pre-provisioned capacity, it would take 34 minutes to scale our Lambda functions to the peak concurrency we needed. And it would cost several thousand dollars.
Completely insane cost. Also, EFS is ridiculously expensive.
You would need to pre-arrange that with your account manager too.
An ALB is hosted on servers, and when you hog those servers, they would need to migrate to bigger.