1
votes

is it possible for a scheduled lambda (via CloudWatch event rule) to run again before its previous run has finished ?

e.g. lets say I have a lambda with a 5 minute max timeout and also have it scheduled to run every minute.

Now, if my Lambda has a long task that uses 4 out of its 5 minute timeout what happens with the other scheduled runs? are they cancelled because the lambda is currently 'in progress' or are they simply triggered in parallel ?

1

1 Answers

4
votes

Yes, multiple concurrent executions of the same lambda function is permitted. AWS Lamba has a concurrent execution limit of 100.

For a function that takes 4 minutes to complete, and with events scheduled per minute to trigger that function.You have maximum of 4 executions at any point, which is below the limit.

When this limit is exceeded, the function is not cancelled but retried based on the nature of the event. Cloudwatch Events, which invoke lambda function asynchronously, are automatically retried for upto six hours with delays between retries.