Lambda Throttling / Cold Start Storm Playbook
Concurrency limits hit, invocations throttled, cold start latency spikes, and downstream timeout cascades. Lambda throttling is silent - functions simply don't execute, and callers get 429s or timeouts with no obvious indication that Lambda is the bottleneck.
Operator's Field Notes
Jeremy Martinez · Incident Commander | Principal Site Reliability Engineer
"Lambda throttling is one of those incidents where the symptoms look like application bugs. API Gateway returns 500s, SQS messages stop processing, Step Functions time out. Nobody thinks 'Lambda concurrency limit' because it's an invisible ceiling. The default account limit is 1,000 concurrent executions - shared across ALL functions in the region. One runaway function can starve everything else."
"Cold start storms happen when traffic spikes and Lambda needs to initialize hundreds of new execution environments simultaneously. Each cold start adds 1-10 seconds of latency depending on your runtime and package size. If your downstream has a 5-second timeout and cold starts take 8 seconds, every new invocation fails. Provisioned concurrency is the fix, but it costs money even when idle."
First 5 Minutes - Triage
1. Check Throttling Metrics
# Check throttles for specific function aws cloudwatch get-metric-statistics --namespace AWS/Lambda \ --metric-name Throttles --dimensions Name=FunctionName,Value=my-function \ --start-time $(date -u -d '1 hour ago' +%Y-%m-%dT%H:%M:%S) \ --end-time $(date -u +%Y-%m-%dT%H:%M:%S) --period 60 --statistics Sum # Check concurrent executions (account level) aws cloudwatch get-metric-statistics --namespace AWS/Lambda \ --metric-name ConcurrentExecutions \ --start-time $(date -u -d '1 hour ago' +%Y-%m-%dT%H:%M:%S) \ --end-time $(date -u +%Y-%m-%dT%H:%M:%S) --period 60 --statistics Maximum # Check account concurrency limit aws lambda get-account-settings # Look for: ConcurrentExecutions (limit) and UnreservedConcurrentExecutions
2. Identify the Culprit Function
# List all functions and their reserved concurrency
aws lambda list-functions --query 'Functions[].{Name:FunctionName,Memory:MemorySize,Timeout:Timeout}' --output table
# Check which functions have reserved concurrency
for fn in $(aws lambda list-functions --query 'Functions[].FunctionName' --output text); do
reserved=$(aws lambda get-function-concurrency --function-name $fn 2>/dev/null)
echo "$fn: $reserved"
done
# Check per-function concurrent executions in CloudWatch
# Sort by ConcurrentExecutions to find the hog3. Check for Cold Start Impact
# Check Init Duration in CloudWatch Logs Insights
# Query:
fields @timestamp, @duration, @initDuration, @billedDuration
| filter @initDuration > 0
| stats count() as coldStarts, avg(@initDuration) as avgInitMs,
max(@initDuration) as maxInitMs by bin(5m)
| sort @timestamp desc
# Check provisioned concurrency utilization
aws lambda get-provisioned-concurrency-config \
--function-name my-function --qualifier prodRecovery Procedures
Immediate: Increase Concurrency Limit
# Request limit increase via Service Quotas aws service-quotas request-service-quota-increase \ --service-code lambda \ --quota-code L-B99A9384 \ --desired-value 3000 # Set reserved concurrency on critical functions aws lambda put-function-concurrency \ --function-name critical-api-handler \ --reserved-concurrent-executions 500 # IMPORTANT: Reserved concurrency SUBTRACTS from the unreserved pool # Don't reserve more than you need or you'll starve other functions
Reduce Cold Start Impact
# Enable provisioned concurrency (keeps environments warm) aws lambda put-provisioned-concurrency-config \ --function-name my-function \ --qualifier prod \ --provisioned-concurrent-executions 100 # Auto-scaling provisioned concurrency aws application-autoscaling register-scalable-target \ --service-namespace lambda \ --resource-id function:my-function:prod \ --scalable-dimension lambda:function:ProvisionedConcurrency \ --min-capacity 50 --max-capacity 500 # Optimize cold start time: # - Reduce deployment package size # - Use Lambda layers for shared dependencies # - Move initialization outside handler function # - Use ARM64 (Graviton2) for faster init # - Avoid VPC unless necessary (adds ENI setup time)
Throttle the Runaway Function
# If one function is consuming all concurrency, throttle it aws lambda put-function-concurrency \ --function-name runaway-function \ --reserved-concurrent-executions 50 # Or temporarily disable the trigger # For SQS trigger: aws lambda update-event-source-mapping \ --uuid ESM_UUID --enabled false # For API Gateway: Set throttling on the stage aws apigateway update-stage --rest-api-id API_ID --stage-name prod \ --patch-operations op=replace,path=/throttling/rateLimit,value=100
Prevention
Concurrency Management
- • Reserve concurrency for critical functions
- • Set max concurrency on SQS triggers
- • CloudWatch alarm on Throttles metric
- • Account-level ConcurrentExecutions alarm at 80%
- • Provisioned concurrency for latency-sensitive paths
Cold Start Optimization
- • Keep deployment packages small (<50MB)
- • Use Lambda SnapStart (Java) or provisioned concurrency
- • Lazy-load SDK clients inside handler
- • ARM64/Graviton2 for faster cold starts
- • Avoid VPC unless required