Interview Prep/Networking/VPC & Cloud Network Design

Your NAT gateway shows ErrorPortAllocation. What is happening and how do you scale it?

AdvancedScenarioVPC & Cloud Network Design
Answer

Situation read → A NAT gateway supports about 55,000 simultaneous connections per destination IP, port and protocol; too many to one endpoint exhausts the ports.

What I'd do →

  1. Check CloudWatch ErrorPortAllocation and ActiveConnectionCount
  2. Find the destination causing it with flow logs
  3. Spread across multiple NAT gateways (one per AZ or per subnet group)
  4. Attach secondary EIPs to the NAT gateway
  5. Reduce connection churn with keep-alive and connection pooling in the app

Why → The limit is per unique destination 3-tuple, so one popular API endpoint is the bottleneck.

Interview tip → Mention that connection reuse in the client is the cheapest fix.

All Networking questions Roadmap: Networking for DevOps

More on VPC & Cloud Network Design