Zappa icon indicating copy to clipboard operation
Zappa copied to clipboard

[Feature] Use lambda-warmer-py decorator to keep more than one lambda instance warm.

Open M0dM opened this issue 7 years ago • 7 comments

Hi,

Context

I am using python3.6 and I want 100 lambda to be warm at all time.

Expected Behavior

Keep 100 lambda warm to serve 100 requests concurrently without cold-start.

Actual Behavior

Current keep warm implementation is only keeping warm a single lambda instance using lambdawrapper could make this a lot more customizable.

Possible Fix

Wrap lambda function using this project ? https://github.com/robhowley/lambda-warmer-py

M0dM avatar Feb 28 '19 09:02 M0dM

I am trying to make it work on my side. Please see this patch : https://gist.github.com/M0dM/c90360495e9924e7be727054b2a61e4e

The idea is to use lambdawarmer only if dependency is existing inside lambda zip package.

M0dM avatar Feb 28 '19 10:02 M0dM

solves #851

matse004 avatar Apr 30 '19 18:04 matse004

@mcrowson @jneves What do you think about this ? I would appreciate if this could be merged, (I can create a PR if needed).

M0dM avatar May 23 '19 13:05 M0dM

Any news on this? This would be really welcome.

ghost avatar Aug 08 '19 06:08 ghost

This might cost you $$$ to keep 100 instance warm. For python, where penalty is mostly bulky libraries/frameworks a better solution is docker checkpoint (RAM dump/load ). While docker-based solution might be complicated for many fullstack coders, who lack devops skills. Thus, if zappa can streamline fighting the cold start with docker, it might be a bomb. Check https://www.imperial.ac.uk/media/imperial-college/faculty-of-engineering/computing/public/1819-ug-projects/StenbomO-Refunction-Eliminating-Serverless-Cold-Starts-Through-Container-Reuse.pdf for in-depth discussion

MontrealSergiy avatar Nov 04 '19 22:11 MontrealSergiy

This might cost you $$$ to keep 100 instance warm. For python, where penalty is mostly bulky libraries/frameworks a better solution is docker checkpoint (RAM dump/load ). While docker-based solution might be complicated for many fullstack coders, who lack devops skills. Thus, if zappa can streamline fighting the cold start with docker, it might be a bomb. Check https://www.imperial.ac.uk/media/imperial-college/faculty-of-engineering/computing/public/1819-ug-projects/StenbomO-Refunction-Eliminating-Serverless-Cold-Starts-Through-Container-Reuse.pdf for in-depth discussion

Seems promissing thanks for the comment ;)

M0dM avatar Nov 05 '19 16:11 M0dM

Any update on this? This feature will be very helpful before we can write CouldFormation for this https://devclass.com/2019/12/04/aws-warms-lambda-devs-hearts-promises-end-to-cold-starts/

tzutalin avatar Dec 30 '19 08:12 tzutalin