Lambda spike connection rejected

On-call incidentMedium30 minAmazon style

Your task

Your product runs as AWS Lambda functions (Node.js) talking directly to an RDS Postgres instance (max_connections=200). A marketing email went out at noon and traffic spiked 8x. The API starts returning 500s with 'remaining connection slots are reserved' / 'too many clients already'. CloudWatch shows Lambda concurrency briefly hit 600. The DB CPU is only at 40%. How do you triage and mitigate, and what's the right architecture?

It covers

  • Connection pool exhaustion
  • Serverless
  • Thundering herd