AWS Lambda 15-Minute Timeout Limits and Architecture
AWS Lambda has a maximum execution timeout of 900 seconds (15 minutes); it does not provide a 30-minute timeout. Diagnose timeout and integration limits first, then choose asynchronous Lambda, Step Functions, or Fargate using measured workload requirements and current regional pricing.

AWS Lambda Has a 15-Minute Maximum Timeout

AWS Lambda function timeout values range from 1 to 900 seconds. A Lambda invocation cannot run for 30 minutes, so workloads that need longer uninterrupted processing must be split into smaller units or moved to another runtime.
Long-running work is not automatically a reason to leave Lambda. Lambda remains useful for event-driven jobs that can checkpoint progress, process bounded batches, and tolerate asynchronous completion. For work that must retain a process for longer than 15 minutes, consider AWS Fargate, Amazon ECS on EC2, AWS Batch, or an orchestration design using AWS Step Functions.
AWS Lambda Timeout, Memory, and Upstream Timeout Triage
Follow each path from symptom to verification before changing timeout or memory settings. Fix the root constraint before applying a temporary override.
| Log / Error Message | What It Means | Next Check |
|---|---|---|
Task timed out after 900.00 seconds | The invocation reached its configured timeout; 900 seconds is the Lambda maximum. | Identify the last completed record or checkpoint and reduce the batch size or split the workflow. |
Runtime.ExitError or signal: killed | The runtime exited unexpectedly; memory pressure is a possible cause, but inspect surrounding logs before assuming OOM. | Review the invocation REPORT line and application errors. |
upstream request timeout or a client-side timeout | A caller, load balancer, API integration, or downstream service ended the request before Lambda completed. | Check the timeout at every hop, including client, API Gateway, ALB, and downstream service settings. |
Connection reset by peer | A downstream endpoint closed an existing connection. | Check downstream idle timeouts, retry behavior, connection reuse, and idempotency. |
Symptom: Lambda reports a timeout. Verify the deployed configuration:
aws lambda get-function-configuration \
--function-name REPLACE_WITH_FUNCTION_NAME \
--query '{Timeout:Timeout,MemorySize:MemorySize,Runtime:Runtime}'Output meaning: If Timeout is less than the observed processing requirement, increasing it may prevent an avoidable timeout, but only up to 900 seconds. If it is already 900, increasing Lambda timeout is not an option.
Next fix: Make each invocation bounded. Store progress after a safe unit of work, pass the next cursor or key to a queue or Step Functions state, and make writes idempotent so a retried unit does not duplicate results.
Symptom: execution time rises while memory usage is unclear. Lambda does not publish a standard CPUUtilization CloudWatch metric merely because Lambda Insights is enabled. Likewise, Max Memory Used appears in Lambda execution REPORT log lines; it is not a standard Lambda metric to alarm on directly.
Verify recent report lines with CloudWatch Logs Insights:
fields @timestamp, @message
| filter @message like /REPORT RequestId/
| parse @message /Duration: (?<durationMs>[0-9.]+) ms/
| parse @message /Max Memory Used: (?<maxMemoryMb>[0-9]+) MB/
| display @timestamp, durationMs, maxMemoryMb, @message
| sort @timestamp desc
| limit 50Output meaning: Memory close to the configured MemorySize is evidence to investigate memory allocation, object retention, or batch size. It does not by itself prove a memory-exit condition.
Next fix: Reduce in-memory batch size, stream large objects where practical, release unneeded references, and test memory changes with representative input. Use application timing, tracing, and downstream metrics to distinguish CPU work from waiting on databases or external APIs.
Symptom: a synchronous HTTP caller fails before Lambda finishes. Verify the integration type and its current documented service quotas and configuration. API Gateway timeout behavior differs by API type, Region, account quota, and integration configuration; a universal 29-second statement is not reliable for all REST API deployments.
Output meaning: If the HTTP path has a shorter limit than the function, a longer Lambda timeout will not preserve the client request.
Next fix: Return an accepted job response, persist a job identifier, and process the work asynchronously through SQS, EventBridge, or Step Functions. A Lambda Function URL is not a universal timeout workaround: confirm its invocation mode, service limits, and every client or proxy timeout before using it for a long response.
AWS Lambda and Fargate Billing Inputs
Do not use a fixed break-even rule based on execution count, duration, or utilization. Compare the workload using current pricing for the selected Region, architecture, operating system, and purchase model.
| Service | Core billing model | Inputs that change the comparison |
|---|---|---|
| AWS Lambda | Charges include requests and execution duration, with duration based on allocated memory and the selected architecture's regional price. | Memory setting, duration, request count, architecture, provisioned concurrency, additional ephemeral storage, data transfer, logging, and network services such as NAT gateways. |
| AWS Fargate | Charges are based on requested vCPU and memory while tasks run, subject to the applicable platform, Region, OS, architecture, and minimum-duration rules. | Task size, task run time, task concurrency, image storage and pulls, data transfer, load balancers, logging, persistent storage, and networking. |
Build a comparison from observed durations and resource settings rather than assumed savings. Include the operational requirements of each design: queue handling, task image maintenance, scaling controls, observability, deployment processes, and failure recovery. Lambda can reduce infrastructure administration for short, event-driven work; Fargate can be appropriate when a containerized worker needs a longer continuous runtime or specialized process control. Neither conclusion follows from duration alone.
AWS Lambda Creation Configuration for a 15-Minute Function
The following is a complete AWS CLI create-function request payload for a ZIP-package Lambda function. Replace every REPLACE_WITH_... value with a value from your account and deployment process. The referenced execution role must already exist, trust Lambda, and have only the permissions required by the function.
{
"FunctionName": "REPLACE_WITH_FUNCTION_NAME",
"Role": "REPLACE_WITH_EXECUTION_ROLE_ARN",
"Runtime": "nodejs20.x",
"Handler": "index.handler",
"Architectures": [
"arm64"
],
"MemorySize": 2048,
"Timeout": 900,
"Description": "Bounded asynchronous batch worker",
"Code": {
"S3Bucket": "REPLACE_WITH_DEPLOYMENT_BUCKET",
"S3Key": "REPLACE_WITH_DEPLOYMENT_OBJECT_KEY"
},
"Environment": {
"Variables": {
"JOB_QUEUE_URL": "REPLACE_WITH_QUEUE_URL",
"CHECKPOINT_BUCKET": "REPLACE_WITH_CHECKPOINT_BUCKET"
}
},
"TracingConfig": {
"Mode": "Active"
},
"Publish": true
}Create the function with aws lambda create-function --cli-input-json file://create-function.json. Configure retry behavior at the event source or asynchronous invocation level, and ensure the handler is idempotent before enabling retries. Avoid adding retry loops that keep an invocation alive until its timeout; they conceal downstream failures and consume the same execution budget.
AWS Lambda, Step Functions, and Fargate Architecture Choices
Choose Lambda when each unit of work can finish within 15 minutes, can be retried safely, and benefits from event-driven scaling. Use Step Functions when the workload needs durable state, explicit retries, wait periods, or coordination across multiple bounded Lambda invocations.
Use Fargate or another container runtime when the worker needs more than 15 minutes of continuous execution, requires process-level control unavailable in Lambda, or is operationally better managed as a long-running container task. Validate the design with representative load tests, current pricing pages, and end-to-end timeout settings rather than unsupported duration thresholds.
For workloads involving committed AI capacity or dedicated infrastructure, see the related AWS Bedrock Provisioned Throughput Costs and EC2/EKS ROI analysis. That decision is separate from Lambda's 15-minute runtime limit and should be evaluated with the workload's own capacity and pricing assumptions.
Frequently Asked Questions
Can I use the 30-minute timeout with API Gateway?
No. API Gateway has a hard integration timeout of 29 seconds. To use the full 30-minute Lambda limit, you must trigger the function asynchronously (via SQS, SNS, or EventBridge) or use a Lambda Function URL, which does not have the 29-second restriction.
Does the 30-minute timeout apply to all regions?
As of late 2026, the 30-minute timeout is available in all major AWS commercial regions. However, always check the 'Service Quotas' console in your specific region to ensure the limit has been lifted for your account.
Is there a performance penalty for longer Lambda runs?
There is no direct performance penalty, but the risk of 'cold starts' is replaced by the risk of 'zombie executions.' If a function hangs, you will be billed for the full 30 minutes. Always implement internal code-level timeouts that are slightly shorter than the Lambda timeout to catch hung processes.
Get the Weekly SMB AI & SaaS Brief
Practical software benchmarks, prompt templates, and ROI breakdowns delivered every Tuesday. No fluff, unsubscribe anytime.