-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
Is there an existing issue for this?
- I have searched the existing issues
Feature description
When an SQS queue has multiple messages available and is configured as an event source for a Lambda function, AWS Lambda will:
- Poll the queue and retrieve messages (up to the batch size)
- Invoke multiple concurrent Lambda instances to process batches in parallel
- Respect the maximumConcurrency setting (or account-level concurrency limits)
- Scale up to handle the message backlog efficiently
Example: If a queue has 100 messages and batchSize: 10, AWS would invoke multiple Lambda instances simultaneously (e.g., 5-10 concurrent executions), each processing 10 messages, rather than processing them sequentially one batch at
a time.
Actual Behavior
LocalStack appears to execute Lambda instances sequentially when processing SQS event source mappings:
- Retrieves a batch of messages from the queue
- Invokes a single Lambda instance
- Waits for that instance to complete
- Only then retrieves the next batch and invokes another instance
This results in significantly slower processing compared to AWS behavior and makes it difficult to test concurrent execution scenarios.
🧑💻 Implementation
No response
Anything else?
• AWS Lambda with SQS https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html
• Scaling and processing https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-scaling