# AWS Lambda timeout

> Fix an AWS Lambda timeout: the 3 second default, the 900 second limit, console and CLI steps to raise it, memory and init fixes, retries and load balancer 502s.

Canonical: https://scaplet.com/errors/cdn/lambda-timeout

Guide Error · CDN and hosting

Fix an AWS Lambda timeout: the 3 second default, the 900 second limit, console and CLI steps to raise it, memory and init fixes, retries and load balancer 502s.

3 min

read

5

sources

Oct 23, 2026

updated

Scaplet Editorial Team

author

In one line

A Lambda timeout means your function ran longer than its configured timeout and Lambda stopped it. AWS's troubleshooting guide shows the error as "Task timed out after 3.00 seconds". The timeout defaults to 3 seconds and can be set from 1 to 900 seconds (15 minutes). Raise it, add memory, trim init code, and make any caller wait longer than the function.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Flambda-timeout%20(%22AWS%20Lambda%20timeout%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Flambda-timeout%20(%22AWS%20Lambda%20timeout%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Flambda-timeout%20(%22AWS%20Lambda%20timeout%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Flambda-timeout%20(%22AWS%20Lambda%20timeout%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 3 parts, 3 minutes.

1. [What the Lambda timeout is 01](#what-the-lambda-timeout-is)
2. [Fix a Lambda timeout 02](#fix-a-lambda-timeout)
3. [Retries, callers and 502s 03](#retries-callers-and-502s)

_01_Timeout facts from the AWS docs

## What the Lambda timeout is

Timeout is the maximum number of seconds a Lambda function can run. AWS's docs give the default as 3 seconds, adjustable in increments of 1 second up to a maximum of 900 seconds (15 minutes). For functions on Lambda Managed Instances, asynchronous invocations and event source mappings (except Amazon MQ and Amazon DocumentDB) allow up to 5,400 seconds (90 minutes).

Item

### Default

Value

3 seconds

Item

### Maximum

Value

900 seconds (15 minutes)

Item

### Maximum, Managed Instances with async or event source mapping invocations

Value

5,400 seconds (90 minutes)

Item

### Example error in the AWS troubleshooting guide

Value

`Task timed out after 3.00 seconds`

Common causes AWS lists: downloads from Amazon S3 that are larger or slower than average, a call to another service that takes longer to respond, and parameters that need more computation. AWS also notes that a timeout close to your average duration risks unexpected timeouts, and that tests should use realistic data sizes, not small samples.

_02_How it works

## Fix a Lambda timeout

AWS CLI: set a 2 minute timeout

```
aws lambda update-function-configuration \ --function-name my-function \ --timeout 120
```

AWS SAM template.yaml

```
Resources: my-function: Type: AWS::Serverless::Function Properties: CodeUri: . MemorySize: 128 Timeout: 120
```

1. 01

### Raise the timeout

In the Lambda console, open the function, choose Configuration > General configuration > Edit, set Timeout between 1 and 900 seconds, and Save.
2. 02

### Give it more memory

AWS says more memory also means proportionally more CPU, which can speed up both the Init and Invoke phases.
3. 03

### Shorten initialization

If the log shows `Sandbox.Timedout`, the Init phase timed out. AWS says Lambda then re-runs Init on the next invoke (a suppressed init), which with a short timeout of around 3 seconds may not finish. Reduce the init code, or raise the timeout.
4. 04

### Fix the slow call

Time the S3 download or downstream call with logs to see which step takes the time.

_03_Explained

## Retries, callers and 502s

By default, when an asynchronous invocation returns an error, Lambda tries two more times, with a one-minute wait between the first two attempts and two minutes between the second and third. AWS counts runtime errors such as timeouts as function errors. For [throttling](/glossary/rate-limiting) (429) and 500-series errors, Lambda requeues the event for up to 6 hours by default. Configure a dead-letter queue or an on-failure destination to capture failed events, and make the function safe to run twice on the same event.

A synchronous caller has its own limit. For an Application Load Balancer with a Lambda target, AWS lists a 502 when the function did not respond before its configured timeout, or returned an error or was throttled, and a 504 when the Lambda service did not respond before the connection timeout. Keep the function timeout shorter than the caller's, and see [AWS 502 Bad Gateway](/errors/cdn/aws-502-bad-gateway), [502 Bad Gateway](/errors/http/502) and [504 Gateway Timeout](/errors/http/504). For the SEO side of 5xx responses, see [5xx server errors](/seo-issues/server-errors-5xx).

Related errors: [API Gateway 504](/errors/cdn/api-gateway-504), [Netlify function timeouts](/errors/cdn/netlify-function-timeout), [Vercel function timeouts](/errors/cdn/vercel-function-invocation-timeout).

Sources · 5

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- amazon.com
- google.com

1. 01 [Configure Lambda function timeout (AWS docs)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-timeout.html) docs.aws.amazon.com · checked 2026-10-25
2. 02 [Troubleshoot invocation issues in Lambda (AWS docs)](https://docs.aws.amazon.com/lambda/latest/dg/troubleshooting-invocation.html) docs.aws.amazon.com · checked 2026-10-25
3. 03 [How Lambda handles errors and retries with asynchronous invocation (AWS docs)](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-error-handling.html) docs.aws.amazon.com · checked 2026-10-25
4. 04 [Troubleshoot your Application Load Balancers (AWS docs)](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-troubleshooting.html) docs.aws.amazon.com · checked 2026-10-25
5. 05 [How HTTP status codes affect Google's crawlers](https://developers.google.com/crawling/docs/troubleshooting/http-status-codes) developers.google.com · checked 2026-10-25

Questions

## Asked a lot.

4 questions people ask next, answered from the sources on this page.

_01_ How do I increase the timeout for a Lambda function?

Open the function in the console, go to Configuration > General configuration > Edit, set Timeout up to 900 seconds and save. Or run `aws lambda update-function-configuration --function-name my-function --timeout 120`.

_02_ How much time can Lambda run?

Up to 900 seconds (15 minutes) in a single invocation. AWS gives 5,400 seconds (90 minutes) for Lambda Managed Instances with asynchronous or event source mapping invocations, except Amazon MQ and Amazon DocumentDB.

_03_ How many times does Lambda retry?

For asynchronous invocations that return an error, such as a timeout, Lambda runs the function two more times, waiting one minute and then two minutes. Throttling and system errors are retried for up to 6 hours by default.

_04_ What is the default Lambda timeout?

3 seconds.

## Keep learning

[All errors](/errors)

[Learn AWS 502 Bad Gateway CDN and hosting errors](/errors/cdn/aws-502-bad-gateway) [Related 504 Gateway Timeout HTTP status codes](/errors/http/504) [Read next ALB 504 Gateway Timeout CDN and hosting errors](/errors/cdn/alb-504-gateway-timeout) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in errors
[Heroku H13: Connection closed without response](/errors/cdn/heroku-h13) [Heroku H14: No web processes running](/errors/cdn/heroku-h14) [Netlify build failed](/errors/cdn/netlify-build-failed) [Netlify function timeout](/errors/cdn/netlify-function-timeout)

More in CDN and hosting errors
[Vercel domain not working](/errors/cdn/vercel-domain-not-working) [Vercel FUNCTION_INVOCATION_TIMEOUT](/errors/cdn/vercel-function-invocation-timeout) [Vercel: too many redirects](/errors/cdn/vercel-too-many-redirects) [Akamai reference number](/errors/cdn/akamai-reference-number) [ALB 503 Service Unavailable](/errors/cdn/alb-503) [ALB 504 Gateway Timeout](/errors/cdn/alb-504-gateway-timeout) [API Gateway 403 Forbidden](/errors/cdn/api-gateway-403-forbidden) [API Gateway 504 Gateway Timeout](/errors/cdn/api-gateway-504) [AWS 502 Bad Gateway](/errors/cdn/aws-502-bad-gateway) [AWS Amplify 404 Not Found](/errors/cdn/amplify-404) [AWS EC2: Connection timed out](/errors/cdn/aws-ec2-connection-timed-out) [AWS Lambda 502 Bad Gateway](/errors/cdn/aws-lambda-502) [AWS Lambda timeout](/errors/cdn/lambda-timeout) [Azure Front Door 502](/errors/cdn/azure-front-door-502) [Cloud Run 503 error](/errors/cdn/cloud-run-503) [Cloudflare 504 Gateway Timeout](/errors/cdn/cloudflare-504) [Cloudflare Pages 404 Not Found](/errors/cdn/cloudflare-pages-404) [Cloudflare too many redirects (ERR_TOO_MANY_REDIRECTS)](/errors/cdn/cloudflare-too-many-redirects) [Cloudflare verify you are human loop](/errors/cdn/cloudflare-verify-you-are-human-loop) [CloudFront 400: Bad Request](/errors/cdn/cloudfront-400) [CloudFront 404 Not Found](/errors/cdn/cloudfront-404) [CloudFront 503: Service Unavailable](/errors/cdn/cloudfront-503) [Firebase Hosting 404](/errors/cdn/firebase-hosting-404) [GitHub Pages 404 Not Found](/errors/cdn/github-pages-404)

Terms on this page
[Rate limiting](/glossary/rate-limiting)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
