Init phase, Lambda performs three tasks:
- Start all extensions (
- Bootstrap the runtime (
- Run the function's static code (
Init phase ends when the runtime and all extensions signal that they are ready by sending a
Next API request. The
Init phase is limited to 10 seconds. If all three tasks do not complete within 10 seconds, Lambda retries the
Init phase at the time of the first function invocation.
When a Lambda function is invoked in response to a
Next API request, Lambda sends an
Invoke event to the runtime and to each extension.
The function's timeout setting limits the duration of the entire
When Lambda is about to shut down the runtime, it sends a
Shutdown event to the runtime and to each external extension. Extensions can use this time for final cleanup tasks. The
Shutdown event is a response to a
Next API request.
Duration: The entire Shutdown phase is capped at 2 seconds. If the runtime or any extension does not respond, Lambda terminates it via a signal (
- AWS Lambda execution environment
- Lambda Cold Starts and Bootstrap Code
- When is the Lambda Init Phase Free, and when is it Billed?