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 →
- Check CloudWatch
ErrorPortAllocationandActiveConnectionCount - Find the destination causing it with flow logs
- Spread across multiple NAT gateways (one per AZ or per subnet group)
- Attach secondary EIPs to the NAT gateway
- 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.
More on VPC & Cloud Network Design
What makes a subnet public versus private in AWS?BeginnerExplain internet gateway versus NAT gateway and when you use each.BeginnerPrivate instances need to pull packages from the internet but must not be reachable from it. What do you set up?BeginnerWhy shouldn't production run in the default VPC?BeginnerPublic IP, Elastic IP and private IP: how do they differ on EC2?BeginnerWhy use SSM Session Manager instead of a bastion host?Beginner