Serhat Can
Jun 1, 2018 · 2 min read

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 effect of cold-start?

  • Frustrated users because of slow response
  • Paying more money for speed (sometimes)
  • Timeouts in the calling function if not thought through — chain reaction
  • 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 the 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

Good links about cold-starts

HackerNoon.com

how hackers start their afternoons.

Serhat Can

Written by

Technical and Developer Evangelism at @OpsGenie

HackerNoon.com

how hackers start their afternoons.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade