AWS Lambda缓存层使用Extensions

huangapple go评论47阅读模式
英文:

AWS Lambda caching layer using Extensions

问题

我有一个使用SSM参数存储值的Lambda函数。它查询ParameterStore并将获取的值存储在Lambda环境变量中,以便下次可以从环境变量中使用它们,而不是在ParameterStore上进行调用,如果Lambda在热状态下运行,这个方法运行良好,但在冷启动期间,我的Lambda在高峰流量期间仍然会频繁调用ParameterStore并收到限制异常。

我希望通过引入缓存层来减少对参数存储的调用次数,我在这篇文章上找到了相关信息,但我对Lambda扩展不太了解。在创建POC之前,我只是想确认这种缓存是否在冷启动之间有效。请给予建议。

提前感谢!

英文:

I have a lambda function that uses SSM ParameterStore values. It queries the ParameterStore and stores the fetched values in Lambda env variables so that next time it can use them from env variables instead of making calls to the ParameterStore which is working fine if the lambda is in a hot-state, but during the cold start still, my lambda is making many calls to ParameterStore during peak traffic and getting throttling exceptions.

I'm looking to reduce the num of calls to the parameter store by having a caching layer, I found this article online, but I'm new to Lambda extensions. I just wanted to check if this caching works between the cold starts or not before I create a POC. please advise.

Thanks in advance!

答案1

得分: 1

AWS有一个专门用于缓存Parameter Store和Secrets Manager值的扩展:

https://aws.amazon.com/blogs/compute/using-the-aws-parameter-and-secrets-lambda-extension-to-cache-parameters-and-secrets/

英文:

AWS has an extension available specifically for caching Parameter Store and Secrets Manager values:

https://aws.amazon.com/blogs/compute/using-the-aws-parameter-and-secrets-lambda-extension-to-cache-parameters-and-secrets/

huangapple
  • 本文由 发表于 2023年2月16日 02:44:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/75464179.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定