Restarting AWS lambda function to clear cache

后端 未结 7 1738
你的背包
你的背包 2021-01-08 00:38

I have a AWS Lambda function that creates an object from a s3 call in cold start. I then hold the object in the cache while the function is warm to keep load times down. W

7条回答
  •  旧巷少年郎
    2021-01-08 00:46

    In addition to some of the valid answers above: I happened to run an experiment on the (average) AWS Lambda instance lifetime. I could not find instances that ran for much longer than (on average) two hours: https://xebia.com/blog/til-that-aws-lambda-terminates-instances-preemptively/.

    TL;DR: AWS Lambda is preemptively terminating instances (even those handling traffic) after two hours, with a standard deviation of 30 minutes.

提交回复
热议问题