Lambda execution life cycle

In order to understand the challenges and subsequently the workaround to scale lambda functions, we need to understand how a lambda function gets executed.

As discussed in Chapter 2, AWS Serverless Offerings, an invocation of the lambda function takes place in a sandbox on an Amazon Linux AMI machine. The details on how and where this sandbox is provisioned and configured is left to Amazon's discretion. The sandbox  provisioning for lambda involves the following steps:

  1. Provisioning of a Sandbox
  2. Copying of the distributable package to the sandbox
  3. Runtime (JRE) startup and ClassLoading

The preceding steps are to be done every time a lambda function is to be invoked in a pristine Sandbox. This bootstrap of a pristine ...

Get Hands-On Serverless Applications with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.