Interview Prep/AWS/ECS, EKS, ECR and Lambda

A Lambda dies with `Runtime exited with error: signal: killed` and `Runtime.ExitError`, and no stack trace.

IntermediateTroubleshootingECS, EKS, ECR and Lambda
Answer

Likely causes → The function ran out of memory. The REPORT line shows Max Memory Used equal to Memory Size. Large files loaded into memory, or a leak across warm invocations from global caches, are common reasons.

Diagnose →

aws logs filter-log-events --log-group-name /aws/lambda/etl \
  --filter-pattern 'REPORT' --max-items 5 --query 'events[].message'

Fix →

  1. Raise MemorySize. Use Lambda Power Tuning to find the cheapest setting that works
  2. Stream large objects instead of loading them whole, and use /tmp (configurable up to 10 GB) for scratch space
  3. Clear global caches between invocations

Prevent → Alarm when Max Memory Used goes above 80% of the configured memory (through Lambda Insights).

aws All AWS questions Roadmap: EKS, ECS & serverless on AWS

More on ECS, EKS, ECR and Lambda