Identifying and handling backpressure - AWS Lambda

Identifying and handling backpressure

If an event producer consistently generates messages for an SQS queue faster than a Lambda function can process the handling, backpressure occurs. In this case, SQS monitoring shows the age of the earliest message growing linearly, along with the approximate number of messages visible. You can detect backpressure in queues by using CloudWatch alarms.

The steps to resolve backpressure depend on your workload. If the primary goal is to increase processing capability and throughput by the Lambda function:

  • Request a concurrency increase in the specific Region from AWS Support.

  • Increase the batch size of the function, so more messages are processed by each function invocation.

To learn more, read Avoiding insurmountable queue backlogs.