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

Callers get `TooManyRequestsException: Rate Exceeded` from Lambda and the `Throttles` metric spikes.

IntermediateTroubleshootingECS, EKS, ECR and Lambda
Answer

Likely causes → You hit concurrency limits: the account limit in the Region (1,000 by default), the function's reserved concurrency, or another function used up the shared pool.

Diagnose →

aws lambda get-account-settings --query 'AccountLimit.[ConcurrentExecutions,UnreservedConcurrentExecutions]'
aws lambda get-function-concurrency --function-name orders-api
aws cloudwatch get-metric-statistics --namespace AWS/Lambda --metric-name ConcurrentExecutions \
  --statistics Maximum --period 60 --start-time $(date -u -d '-1 hour' +%FT%TZ) --end-time $(date -u +%FT%TZ)

Fix →

  1. Request an account concurrency increase through Service Quotas
  2. Give critical functions reserved concurrency, and cap noisy ones
  3. Put SQS in front of bursty async producers

Prevent → Alarm on ConcurrentExecutions near the limit, and on Throttles above 0 for synchronous APIs.

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

More on ECS, EKS, ECR and Lambda