Ephemeral port exhaustion from disabled keep-alive
Your task
A high-throughput billing worker that makes many short-lived HTTPS calls to a payment processor starts logging 'cannot assign requested address' (EADDRNOTAVAIL) on outbound connects at peak, ~16:00 daily. The processor's endpoint and the worker IP are fixed. ss -s shows ~28,000 sockets in TIME_WAIT to a single (dst IP, dst port 443) tuple. net.ipv4.ip_local_port_range is the default 32768–60999. The team recently 'optimized' an HTTP client by disabling keep-alive to 'avoid stale connections' after an unrelated incident. Throughput is up 20% week over week. Triage and fix.
It covers
- Time wait
- Nat
- Outbound connections