0

If a Lambda function has a concurrency>1, and there are several instances running, does a CloudWatch event Lambda trigger get sent to all the running instances?

1
  • 1
    If you are asking if when there are say 10 lambdas running concurrently will the CloudWatch event trigger them all to execute the function again, then the answer is no... The event will only trigger one execution... Concurrency is how many simultaneous executions of the function there are. If you need 10 of them to run simultaneously you’d need to build that in logically. Commented May 8, 2020 at 1:57

1 Answer 1

1

The question wording is a little bit ambiguous. I will try my best to make it more clear.

If a Lambda function has a concurrency>1, and there are several instances running

I think OP is talking about reserved concurrency which is set to a value that's greater than 1. In other words, the function is not throttled by default and can run multiple instances in parallel.

does a CloudWatch event Lambda trigger get sent to all the running instances?

This part is ambiguous. @hephalump provided one interpretation in the question comment.

I have another interpretation. If you are asking whether the currently-running lambda containers will be reused after the job is done, then here is the answer:

Based on @hephalump's comment, now it's clear that one CloudWatch event will only trigger one lambda instance to run. If multiple events come in during a short period of time, then multiple lambda instances will be triggered to run in parallel. Back to the question, if all existing lambda instances of that function are busy running, then no container will be reused, and another new lambda instance will be spun up to handle this event. If one of the running instances has just finished its job, then that container along with the execution environment will be reused to handle this incoming event from CloudWatch.

Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.