Search code examples
amazon-web-servicesaws-lambda

How can I set lambda maximum concurrency without reserving concurrency?


I'd like to limit my lambda maximum execution concurrency and I come cross reserved concurrency which can be used to achieve this goal. However, once I reserve other lambdas won't be able to use the concurrency which I don't want to impact other lambdas.

How can I set a maximum concurrency on my lambda without using reserved one? I am happy to put a queue e.g. SQS, Dynamodb stream, EventBridge etc. but I can't find a solution from them.


Solution

  • How can I set a maximum concurrency on my lambda without using reserved one?

    You can't. If you don't want to use reserved concurency, then there is no other way to reliably throttle your function.

    You could though set event source mapping between SQS and Lambda, with batch size of 1 and high Batch window. But this still does not stop from executing your function "manually", or setting up other triggers for it (sns, event bridge, ...) so that it uses high concurrency.