AWS Lambda cold-start timeouts for VPC-enabled Node.js functions caused by ENI allocation delays
Environment
AWS Lambda (Node.js 16) functions configured to access RDS in private subnets; each function runs in VPC with no provisioned concurrency. Cold starts occasionally add 5–15s latency and sometimes produce client HTTP timeouts. Functions without VPC run within 200–400ms.
Symptoms
Cold invocations that require a new execution environment take 5–15s before code executes. CloudWatch logs show long delays before init logs; ENI attach and elastic network interface creation events seen in VPC flow logs. Provisioned concurrency reduces occurrences.
Observations
Problem correlates with scale-up events. NAT Gateway and subnet capacity appear normal; no obvious API throttling. Enabling a small provisioned concurrency reduces timeout frequency but increases cost. Using VPC-type-free architecture removes the extra latency entirely.
Already attempted
Added provisioned concurrency for critical functions (helpful), increased memory allocation (marginal effect), verified subnets have available IP capacity, created VPC endpoints for S3/API calls—no direct improvement for ENI attach time.
Question
How to reduce cold-start delays for VPC-enabled Lambdas without large cost increases? Are there configuration or architectural changes to avoid ENI attach latency?
Verified community troubleshooting
No answers yet..