Home > database >  Retrieving AWS SSM Parameter taking a long time
Retrieving AWS SSM Parameter taking a long time

Time:09-08

I have a python lambda that forwards requests to an external API. The lambda is part of a target group that an ALB targets. The lambda goes through surges where it has to handle hundreds of invocations per second.

Everything works well for the most part except for when we hit some odd issue where it will take upwards of 20 seconds or so to retrieve a secure string param from parameter store. When that delay of 20 seconds occurs, the system making the call to our alb times out and throws an error.

I was thinking that I could do the ssm param retrieval in an init method of the lambda and then keep the lambda always warm but that seems like a waste of resources just to manage the ssm param reading issue.

Are there any suggestions on how this should be done or configured (or if perhaps I'm overlooking something that I should be doing)?

CodePudding user response:

Every AWS API has a request limit - https://aws.amazon.com/premiumsupport/knowledge-center/ssm-parameter-store-rate-exceeded/

So, yes you should cache your parameters - How do I cache multiple AWS Parameter Store values in an AWS Lambda?

  • Related