Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
There are many blog posts about cold starts in AWS Lambda out there. I was doing some research and wanted to list the good ones here as well as some bullet points for quick insights into the topic.
What is a cold start?
A latency experienced when you trigger a function.
A cold start only happens if there is no idle container available waiting to run the code. This is all invisible to the user and AWS has full control over when to kill containers.
What is the affect of cold-start?
- Frustrated users because of slow response
- Paying more money for speed (sometimes)
- Timeouts in the calling function if not thought throughly
- Caring about an operational concern which has nothing to do with you
When should you care?
- If you are using a statically typed language like Java and C# (no shame in there! :D)
- If you have a customer facing / sync application
- If your request volume is low or sparse
- Once you deploy a new version (all containers are destroyed)
What are the factors which increase cold-start time?
- The language choice
- Memory size
- Code size
- VPC
- HTTPS calls
- Things that require classpath scan (Java)
What are the solutions to this problem?
First, accept that you can’t guarantee that you won’t experience cold-starts. The ultimate solution must come from the cloud provider. We can only try to improve.
- Do nothing if it is not a huge problem (recommended)
- Wait for AWS to improve it
- Increase memory (and pay more)
- Do some warm-up (do it smart though!)
Good links about cold-starts
- How does language, memory and package size affect cold starts of AWS Lambda?
- Dealing with cold starts in AWS Lambda
- I’m afraid you’re thinking about AWS Lambda cold starts all wrong
- Keeping Functions Warm - How To Fix AWS Lambda Cold Start Issues
- FidelLimited/serverless-plugin-warmup
- Resolving Cold Start️ in AWS Lambda
- How to Warmup
Checkout Thundra.io to learn How to Warmup!
Everything you need to know about cold starts in AWS Lambda was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.