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:
- Provisioning of a Sandbox
- Copying of the distributable package to the sandbox
- 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 ...