Error": "Lambda.TooManyRequestsException"

0

Hi Team, i am facing below error please help me for solution. "Error": "Lambda.TooManyRequestsException", "Cause": "Rate Exceeded. (Service: AWSLambda; Status Code: 429; Error Code: TooManyRequestsException; Request ID: ce268cb4-32b9-46ce-882e-0321506ef544; Proxy: null)" .

i tried with MaxConcurrency: 200 and timeout in aws step function yml file

stepFunctions: stateMachines: preProcessProduct: name: processProductARN-${sls:stage} definition: Comment: "Product updation/creation through the Amazon States Language using an AWS Lambda Function" StartAt: preProcessProduct States: preProcessProduct: Type: Task Resource: "arn:aws:lambda:${self:provider.region}:XXX:function:${self:service}-dev-preProcessProduct" ResultPath: $ Catch: - ErrorEquals: [States.ALL] ResultPath: $.preProcessProductError Next: userError Next: processProductMap processProductMap: Type: Map InputPath: $ # ItemsPath: $ MaxConcurrency: 200 Iterator: StartAt: processProduct States: processProduct: Type: Task Resource: "arn:aws:lambda:${self:provider.region}:XXX:function:${self:service}-dev-processProduct" ResultPath: $.outPut TimeoutSeconds: 60 Retry: - ErrorEquals: [ "TooManyRequestsException" ] IntervalSeconds: 60 MaxAttempts: 2
Catch: - ErrorEquals: [States.ALL] ResultPath: $.processProductError Next: processProductError End: true

1 Answer
0

Hello,

The error relates to the underlying Lambda function, so you have either reached the default account limit of 1000 parallel lambda executions. Or the lambda you're trying to execute has a configured concurrency that you max out.

https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html

The MaxConcurrency on the StepFunction relates to the specific Step in that execution. So if you have a Type: Map with MaxConcurrency: 200, then do 6 executions on that StepFunction, and you will execute 1200 lambdas in parallel.

The Lambda limits is shared by the whole account and region, so any other execution on any lambda might contribute the problem as well.

I storing recommend that you FunctionConcurrency on lambdas that will be triggered this much so that they don't affect the rest of your account executions.

Hope this helps!

Regards,

Carl Östrand

profile picture
answered 2 years ago
  • i am facing below error while Edit concurrency in function configuration

    The unreserved account concurrency can't go below 10.

    I am facing this issue with 120 request (from csv file reading) then calling calling step function by using above yml configuration. Error": "Lambda.TooManyRequestsException"

  • Please keep in mind that these limits are on the Account level so if: Lambda_1 have 500 reserved concurrency (out of 1000). Lambda_2 have 400 reserved concurrency.

    Now you can maximum give Lambda_3 90 reserved concurrency, otherwise, you will get the error: "The unreserved account concurrency can't go below 10."

    So if you now give Lambda_3 90 reserved concurrency, you only have 10 executions left. So Lambda_4 is at a high risk of getting Lambda.TooManyRequestsException error, especially if you run 120 parallel executions.

    To resolve this issue, I would:

    1. Look at the reserved concurrency of the other Lambdas in your account
    2. Look at Cloudwatch and see if you have a Lambda that is being executed a lot and is eating up your limits.

    Hope it helps!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions