Services in private subnets randomly fail outbound calls to a partner API; CloudWatch shows `ErrorPortAllocation` rising on the NAT gateway.
AdvancedTroubleshootingCloud provider issues
Answer
Likely causes → NAT gateway source-port exhaustion. A NAT gateway IP supports about 55,000 simultaneous connections to one destination IP and port. Many pods opening new short-lived connections to the same partner endpoint (no keep-alive, no pooling) run out of ports.
Diagnose →
aws cloudwatch get-metric-statistics --namespace AWS/NATGateway --metric-name ErrorPortAllocation \
--dimensions Name=NatGatewayId,Value=$NAT --statistics Sum --period 60 \
--start-time $(date -u -d '-1 hour' +%FT%TZ) --end-time $(date -u +%FT%TZ)
Also check ActiveConnectionCount and ConnectionAttemptCount, and VPC Flow Logs for top destinations.
Fix → Reuse connections (HTTP keep-alive, connection pools), and add secondary IPs to the NAT gateway (each adds another ~55k ports per destination), or spread traffic across more NAT gateways.
Prevent → Alarm on ErrorPortAllocation > 0, use VPC endpoints for AWS services so they bypass NAT, and review clients that open a new connection per request.
More on Cloud provider issues
A deploy script and several services start failing with "An error occurred (ThrottlingException) when calling the DescribeInstances operation: Rate exceeded".BeginnerThe Auto Scaling group can't launch new instances during a traffic spike; activity history says "We currently do not have sufficient c6i.4xlarge capacity in the Availability Zone you requested."BeginnerScaling out fails with "You have requested more vCPU capacity than your current vCPU limit of 256 allows for the instance bucket that the specified instance type belongs to."BeginnerThe AWS Health Dashboard reports increased error rates in `use1-az4`, and your ALB targets in that AZ are timing out intermittently.IntermediateA data pipeline writing millions of small objects to S3 starts failing with "503 Slow Down: Please reduce your request rate."IntermediateA Lambda-based API starts returning 429 "Rate Exceeded" and logs show `TooManyRequestsException` during a marketing campaign.Intermediate