# Recursive Lambda function invocation | Cloud Efficiency Hub

Canonical: https://www.pointfive.co/efficiency-hub/inefficiencies/recursive-lambda-function-invocation

Recursive invocation occurs when a Lambda function triggers itself directly or indirectly, often through an event source like SQS, SNS, or another Lambda.

By: Liam Greenamyre

Updated: 2026-09-28

[Cloud Efficiency Hub](https://www.pointfive.co/efficiency-hub) 

# Recursive Lambda Function Invocation

The short version

Recursive invocation occurs when a Lambda function triggers itself directly or indirectly, often through an event source like SQS, SNS, or another Lambda.

[Liam Greenamyre](https://www.linkedin.com/in/liam-greenamyre-01606310/)

Principal Product Manager (Technical - External Services) @ Amazon Web Services (AWS)

AWS service

[AWS Lambda](https://www.pointfive.co/efficiency-hub/cloud-services/aws-lambda)

Category

[Compute](https://www.pointfive.co/efficiency-hub/service-category/compute)

Reference

CER-0165

Type

Inefficient Configuration

## Explanation

Why the waste happens and who it affects.

This loop can be unintentional - for example, when the function writes output to a queue it also consumes. Lambda recursive loop detection, on by default, stops loops through SQS, SNS, S3, EventBridge custom event buses and Lambda-to-Lambda calls after about 16 invocations in the same chain when a supported AWS SDK is used. Loops through other services (e.g., DynamoDB), functions on older SDKs, or functions set to allow recursive loops can still lead to runaway invocations, dramatically increasing cost with no business value.

## Billing model

The pricing dimensions that drive this cost.

- Billed per request and per millisecond of execution time

- Recursive invocations amplify both request count and total execution duration

## How to detect

6 checks to find it in your estate.

- Review Lambda functions for high and sustained invocation rates with no matching business activity

- Review event source and destination configurations for circular references (e.g., writing back to a triggering SQS queue)

- Check CloudWatch Logs for repetitive invocation patterns with identical payloads

- Correlate Lambda cost spikes with recent deployments or configuration changes

- Assess if DLQs or concurrency limits are missing from functions with self-trigger patterns

- Alarm on the RecursiveInvocationsDropped metric and review functions whose recursive loop detection is set to Allow

## How to fix

6 ways to remove the waste.

- Refactor logic to prevent self-invocation or recursive event loops

- Avoid writing to the same queue or stream that triggers the function

- Implement Dead Letter Queues to prevent retry loops

- Cap concurrency with reserved concurrency (\`ReservedConcurrentExecutions\`), and separately limit retries with \`MaximumRetryAttempts\` (asynchronous invocations and stream sources) or \`maxReceiveCount\` (SQS)

- Utilize anomaly detection software to flag unusual invocation or cost patterns

- Monitor function triggers and outputs as part of deployment validation

## Documentation

Vendor references for pricing and configuration.

[https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html) 
[https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html) 
[https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html\\#invocation-dlq](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq) 
[https://aws.amazon.com/lambda/pricing/](https://aws.amazon.com/lambda/pricing/)

## Related inefficiencies

[Browse the library](https://www.pointfive.co/efficiency-hub)

- AWS Lambda  CER-0204

### [Inefficient SnapStart Configuration in Lambda](https://www.pointfive.co/efficiency-hub/inefficiencies/inefficient-snapstart-configuration-in-lambda)

SnapStart reduces cold-start latency, but when configured inefficiently, it can increase costs. For Python and .NET functions, high-traffic workloads can trigger frequent snapshot restorations, multiplying costs. Slow initialization code...

Compute

- AWS Lambda  CER-0230

### [Excessive Lambda Duration from Synchronous Waiting](https://www.pointfive.co/efficiency-hub/inefficiencies/excessive-lambda-duration-from-synchronous-waiting)

Some Lambda functions perform synchronous calls to other services, APIs, or internal microservices and wait for the response before proceeding. During this time, the Lambda is idle from a compute perspective but still fully billed. This...

Compute

- AWS Lambda  CER-0218

### [Suboptimal Architecture Selection in AWS Lambda](https://www.pointfive.co/efficiency-hub/inefficiencies/suboptimal-architecture-selection-in-aws-lambda)

Lambda functions default to the x86\_64 architecture, which is more expensive than Arm64. For many workloads, especially those written in interpreted languages (e.g., Python, Node.js) or compiled to architecture-neutral bytecode (e.g.,...

Compute

---
Source: the public page above. Product screenshots and illustrative interfaces are examples, not live customer data.

