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

ปุ่มแปลไทยจะเปิดบทความผ่าน Google Translate เพื่อแปลอัตโนมัติ โดยคงโค้ดและคำสั่งไว้ตามต้นฉบับ

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 · 2 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.

Collect the evidence

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

Explain the result

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 rollback

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 results