News for hackers. Stuff that matters.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by jedberg on Thursday November 29, 2018 @01:08PM (#18562285)
You can generally resolve it yourself by poking seldom used functions to keep them hot. But no, they haven’t provided a solution to cold start (unless you consider ec2 or fargate a solution).
Re:New for AWS Lambda: Use Any Programming Language and Shar... by antimatter on Thursday November 29, 2018 @01:23PM (#18562438)
> You can generally resolve it yourself by poking seldom used functions to keep them hot.

We've tried this and it helps somewhat but when AWS attempts to scale your function based on load, cold starts re-appear. We've moved away from Lambdas where a dependable response time is required.

Re:New for AWS Lambda: Use Any Programming Language and Shar... by Touche on Thursday November 29, 2018 @01:33PM (#18562527)
Can you explain more about why this is?

If you are experiencing cold starts it means that function is not used very often. If it's not used very often that likely means it's not user facing (or something less important like a Terms of Service page). If that's the case, why do you need instant response times?

Re:New for AWS Lambda: Use Any Programming Language and Shar... by count on Thursday November 29, 2018 @01:49PM (#18562687)
No, that's not what it means. If you have high concurrent execution, you get 'cold start' every time the underlying service 'scales out' to support more. The MORE you use lambda concurrently, the more you hit the cold start issue. Granted, it's just for that one cold start execution per-scale node (and they could probably just optionally pre-fire to warm things in that instance, like with a cache), but it's definitely there horizontally.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by spullara on Thursday November 29, 2018 @04:31PM (#18564223)
I really with they would add an init() callback that is called on cold start but before any traffic is sent to your lambda. It wouldn't help when there are no lambdas running but it could be useful when things are scaling up, especially if you can ask for additional concurrency above the actual concurrency necessary for spikes.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by redisman on Friday November 30, 2018 @12:08AM (#18566862)
More lifecycle events please! I'd love a onThawed and onFrozen or something so I can kill the DB connections neatly
Re:New for AWS Lambda: Use Any Programming Language and Shar... by jacobr1 on Friday November 30, 2018 @12:34AM (#18566967)
You can already do this, I think. Just put this logic in your application's static initialization.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by spullara on Friday November 30, 2018 @01:46AM (#18567250)
I don't think so. When it spins it up, the request is already in flight. Otherwise this would have been solved by everyone but instead everyone sees terrible cold start times.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by deegles on Thursday November 29, 2018 @01:59PM (#18562792)
Also, containers are restarted periodically (~4 hours) so even if you have very steady traffic you'll see cold starts regularly.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by hn_throwaway_99 on Thursday November 29, 2018 @02:20PM (#18563029)
This is along the lines of what the other responses to this comment have said, but https://hackernoon.com/im-afraid-you-re-thinking-about-aws-l... gives a very detailed overview. It's titled "I'm afraid you’re thinking about AWS Lambda cold starts all wrong", because the way you're thinking about cold start times is common (and wrong).
Re:New for AWS Lambda: Use Any Programming Language and Shar... by mirceal on Thursday November 29, 2018 @01:48PM (#18562678)
that’s not entirely true. while your warm lambdas can and will take the traffic it your traffic ramps up, additional lambda instances will be spun up. you will pay cold start prices as they are spinning up. so, even if you have a heavily used lambda fn, depending on the traffic your p99 will still look pretty bad and you will not be able to guarantee that all requests will be processes in x ms or less.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by jvanvleet on Thursday November 29, 2018 @01:34PM (#18562540)
https://github.com/awslabs/aws-lambda-cpp makes claims of millisecond cold start.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by nostrebored on Thursday November 29, 2018 @03:20PM (#18563585)
That's not for in-VPC functions, although if the underlying instance changes with firecracker migration users might see ENI start improvements. Currently your ENI usage is roughly floor(3GB/Memory Allocation)*(Concurrent Executions). If the 3GB changes users will see huge gains as each ENI creation can take around 9s.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by k__ on Thursday November 29, 2018 @04:04PM (#18563997)
Why would you use VPC functions?
Re:New for AWS Lambda: Use Any Programming Language and Shar... by Wintereise on Thursday November 29, 2018 @04:49PM (#18564402)
Mostly due to being forced. For example: serverless aurora forces a VPC on you.

With delays as bad as 8+ seconds for ENI attachment, this is a significant holdback (https://medium.freecodecamp.org/lambda-vpc-cold-starts-a-lat...)

Re:New for AWS Lambda: Use Any Programming Language and Shar... by zwily on Thursday November 29, 2018 @06:16PM (#18565095)
I believe you can now use Aurora Serverless outside of a VPC by using the new Data API endpoint.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by Wintereise on Thursday November 29, 2018 @07:32PM (#18565571)
You indeed can, but it's beta (us-east-1 only at the moment) and leaves a lot to be desired (https://www.jeremydaly.com/aurora-serverless-data-api-a-firs...)
Re:New for AWS Lambda: Use Any Programming Language and Shar... by k__ on Thursday November 29, 2018 @06:05PM (#18565011)
Ah okay, I never thought about using an SQL DB.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by jvanvleet on Thursday November 29, 2018 @04:17PM (#18564100)
True. In-VPC has extra costs.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by hn_throwaway_99 on Thursday November 29, 2018 @02:13PM (#18562952)
I'm wondering how that's even possible if it includes the time for downloading your code from S3. I.e. normal cold starts (as I understand it) involve fetching the code from S3 to install on a VM. Perhaps they aren't including that time when claiming single milli cold start times?