← Back to all fixes
Lambda function times out
The Issue
Lambda function returns: `Task timed out after 3.00 seconds`
Root Cause
Default Lambda timeout is 3 seconds. If your function does DB queries, calls external APIs, or processes large files, it exceeds this limit.
How to Fix
Increase timeout in Lambda console (Configuration > General configuration) — max is 15 minutesProfile what is slow inside the function — add timestamps around each operationMove heavy processing to a background job (SQS + Lambda consumer) instead of synchronousFor very long tasks: use Step Functions or ECS Fargate instead of LambdaSet timeout to expected duration + 20% buffer, not the maximum