Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why is AWS Lambda resetting every ~2hrs even with regular ping from EventBridge?

I have a Lambda function that has an unacceptably long start-up time due to large files being transferred on initialisation. Once this is done, the actual data processing is very quick

I’ve set up a rule with EventBridge that keeps the function warm by sending a dummy request every 4 minutes. I’ve set these dummy requests up such that they only take a few ms after the initial request.

For this most part this seems to be working well – on the logs I see one long request and then all of the ones afterwards are quick.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

However, I notice that every 128 minutes I get another long request, as if the Lambda function is ‘resetting’, despite the warming rule.

Does anyone know why this is happening? I don’t understand why I’m getting these intermittent long requests if the function is being kept warm..

>Solution :

A lambda function instance has a maximum lifetime of about 2 hours even if it’s in use. If you want to keep an instance alive then you should use provisioned concurrency.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading