重新启动AWS lambda函数以清除缓存 [英] Restarting AWS lambda function to clear cache
问题描述
我有一个AWS Lambda函数,该函数在冷启动时通过s3调用创建对象.然后,我在函数预热时将对象保存在缓存中,以减少加载时间.在s3中更改文件时,我有一个触发器来运行lambda,但是并非所有正在运行的lambda实例都会重新启动并从s3中提取.
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. When files are changed in s3, I have a trigger to run the lambda, but not all the running instances of lambda restart and pull from s3.
是否有办法降低所有强制完全冷启动的lambda实例?
Is there a way to bring down all instances of lambda forcing a full cold start?
此外,我不想使用python.
Also, I don't want to use python.
推荐答案
使用 AWS SDK 对此进行了总结,使您可以更轻松地使用首选语言来调用API.
Use the UpdateFunctionCode
API endpoint to force a refresh of all containers. AWS SDKs wrap this up to make it easier for you to call the API using your preferred language.
这篇关于重新启动AWS lambda函数以清除缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!