Keeping the server warm
Zappa enables a feature that keeps AWS Lambda in a warm state. AWS Lambda has a cold start because of containerization, and so Lambda requires that you set up the environment in order to execute functions. Whenever AWS Lambda receives a request, it instantiates the Lambda function along with its required environment and finally destroys the instance after fulfilling the request.
That's how AWS Lambda works. Hence, Zappa implements this mechanism using the AWS CloudWatch event schedule feature in order to keep the instantiated Lambda instance in a warm state. Keeping Lambda in the warm state is nothing but triggering the CloudWatch event as a ping request every four minutes to prevent the destruction of the Lambda instance. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access