Wow, sounds easy--almost as if it should be that way out of the box...
The economics don't work out if they keep them all hot all the time.
Woot can't they give a simple Boolean seeing for a slightly higher price: "always up"?
It's probably not as easy as that. Lambda functions run in a container. If you have a spike in traffic, you may have 10 different containers handling requests. So should they keep 1 container always up, or 3, or 10. I suppose you could have some ELB-type rules to "auto-scale" new containers...
*why can't they
My mobile client's edit doesn't work
They do for me. It's basically free to fire a function every 5 minutes, have the function immediately close, and have that Lambda container sit around for another ~10 minutes "hot" and waiting for a real request to handle.
Aren't these cloudwatch/cron events basically doing exactly that? People are keeping their functions hot and not using resources but AWS is having to keep those containers up 100% of the time
Yes, but by making it something you have to laboriously set up rather than a default 95% of people won't do it, and you can afford to let 5% do this hack without jacking up low-end prices.
One of the big problems with Lambda cold starts is the concurrency issue, especially if your Lambdas are running inside a VPC: https://hackernoon.com/im-afraid-you-re-thinking-about-aws-l...
That sounds like a hack, not a working solution
At that point, if you’re running it all the time anyways, why not just have something like an auto scaling Kubernetes cluster?
Because the cost and level-of-effort difference between those two options isn't comparable. Firing a function in a way that keeps it awake but uses no perceptible resources is simple and basically free.
Cold starts as an issue? I mean, all you have to do is create a CloudWatch event (or cron if you want an explicit server involved) to fire the Lambda function every few minutes and you're all good. Sure, if you get heavy traffic, I suppose you could have multiple containers running simultaneously? But that's also easy enough to handle w/ CW events.