I have an AWS Lambda function with a timeout of 3 minutes and an SQS queue with a visibility timeout of 3 minutes. Maybe I don't understand something here, but why do my messages only trigger a lambda every 3 minutes?
I have concurrency configured for up to 10 lambdas at a time, so from my understanding I should be able to execute multiple lambdas at the same time. Am I missing something here?
First, please note this recommendation from Using Lambda with Amazon SQS - AWS Lambda:
To allow your function time to process each batch of records, set the source queue's visibility timeout to at least six times the timeout that you configure on your function. The extra time allows for Lambda to retry if your function is throttled while processing a previous batch.
Since your Lambda function is configured with a 3-minute timeout, the recommendation would be to set the SQS queue visibility timeout to 18 minutes.
The fact that your "messages only trigger a lambda every 3 minutes" suggests to that the Lambda function is not correctly indicating that a message was processed. This then causes the message to be re-processed, but only after the SQS invisibility timeout is met.
The vast majority of your messages should be successfully processed without hitting any errors or timeouts. If this is not the case, then examine CloudWatch Logs to determine whether/why messages are failing to process.