# Excessive Lambda duration from synchronous waiting

Canonical: 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.

By: Igor Bareev

Updated: 2026-09-28

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

# Excessive Lambda Duration from Synchronous Waiting

The short version

Some Lambda functions perform synchronous calls to other services, APIs, or internal microservices and wait for the response before proceeding.

[Igor Bareev](https://www.linkedin.com/in/igor-bareev/)

Sr TAM @ 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-0230

Type

Inefficient Configuration

## Explanation

Why the waste happens and who it affects.

During this time, the Lambda is idle from a compute perspective but still fully billed. This anti-pattern can lead to unnecessarily long durations and elevated costs, especially when repeated across high-volume workflows or under memory-intensive configurations.

While this behavior might be functionally correct, it is rarely optimal. Asynchronous invocation patterns - such as decoupling downstream calls with queues, events, or callbacks-can reduce runtime and avoid charging for waiting time. However, detecting this inefficiency is nontrivial, as high duration alone doesn't always indicate synchronous waiting. Understanding function logic and workload patterns is key.

## Billing model

The pricing dimensions that drive this cost.

Lambda costs are based on two primary dimensions: the number of requests, and duration, measured in GB-seconds (allocated memory multiplied by execution time, rounded up to the nearest 1 ms). Duration runs from the time the code begins executing until it returns or otherwise terminates, so time spent waiting on a synchronous downstream call is billed the same as active compute.

## How to detect

6 checks to find it in your estate.

- Review Lambda functions with consistently high average or p95 durations relative to expected execution complexity

- Identify functions that invoke external services or APIs synchronously

- Check whether long execution times correspond to periods of low CPU or memory utilization

- Evaluate whether downstream systems could be decoupled or moved to an async pattern

- Consult application owners to confirm whether waiting time is built into function logic

- Correlate duration spikes with network latency or known API response delays

## How to fix

4 ways to remove the waste.

- Redesign functions to offload synchronous calls using asynchronous patterns (e.g., queues, event buses, Step Functions), or use Lambda durable functions, whose wait operations suspend execution so on-demand functions are not billed duration while waiting

- Break apart long-running workflows into smaller chained or event-driven Lambdas

- Optimize memory allocation to minimize idle cost when waiting cannot be avoided

- Include async design principles in serverless architecture reviews

## Documentation

Vendor references for pricing and configuration.

- [https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro.html  docs.aws.amazon.com](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro.html)

- [https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html  docs.aws.amazon.com](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html)

- [https://www.getorchestra.io/guides/anti-pattern-in-aws-lambda-synchronous-waiting-within-a-function  getorchestra.io](https://www.getorchestra.io/guides/anti-pattern-in-aws-lambda-synchronous-waiting-within-a-function)

## 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-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

- AWS Lambda  CER-0213

### [Excessive Lambda Retries (Retry Storms)](https://www.pointfive.co/efficiency-hub/inefficiencies/excessive-lambda-retries-retry-storms)

Retry storms occur when a function fails and is automatically retried repeatedly by the service that invoked it: asynchronous invocations (e.g., EventBridge, SNS, S3) are retried twice by default after function errors, SQS event source...

Compute

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

