Merry Christmas & Happy 2027! Less downtime. More good times. Celebrating 13 years of sorlavit.com
Skip to content
Sorlavit KimIT Support, Network & Infrastructure Services Let’s talk

Articles are written in English. The Thai translation button opens Google Translate; code and commands stay in their original form.

Network & Infrastructure / Linux Networking & Host Performance

Ephemeral-port exhaustion in a high-churn client application

A service cannot open new outbound connections to one destination even though the network is reachable. Its local source-port space may be constrained by connection churn and retained state.

Compiled for Sorlavit Kim · Published · Updated · 1 min read

Environment and inputs: Linux network namespaces, host routing and network drivers; availability and semantics depend on kernel and driver versions. Diagnostic/design example; not tested on production equipment.

What to check first

Collect socket errors, connection states, destination concentration, source-address selection and the configured ephemeral range. Compare client-side failures with gateway NAT allocation evidence.

What the results mean

Available connection tuples are finite and depend on source/destination combinations and lifecycle rules. A high TIME_WAIT count is evidence to interpret, not proof that every retained socket should be removed.

Plan the fix

Reduce unnecessary connection creation with suitable application reuse and size source-address capacity for the workload. Avoid unsupported TCP reuse tuning that risks correctness to recover short-term capacity.

Check the result and know how to undo the change

Load-test realistic request patterns and verify completed work, not only successful connects. Restore previous settings if stale connection confusion or intermittent data delivery appears.

Share this article

Back to all articles