Home > OS >  Cannot limit concurrency number
Cannot limit concurrency number

Time:01-27

I am working on AWS Lambda. Currently, I need to send multiple requests to an external API. However, the API allows only 25 requests per second. In my case, there could be a case the number of requests are over 100. Based on concurrency setting, I set 25 but not seem to get worked. Does anybody know if there is an additional setting to handle this situation?

enter image description here

CodePudding user response:

If the external API is measured on a per second basis but the requests sent to your lambda are taking less than a second to process, then you could easily overload the backend API. You would need to constrain each lambda to process no more than 1 call to the external API per second. A simple way to test this would be to add a wait time to each lambda to ensure that the function ran for at least one second per request. If this resolved your overloading issue, then you could set about implementing your throttling capability in a more optimal way.

  •  Tags:  
  • Related