Your server shows thousands of sockets in TIME_WAIT. Is that a problem?
IntermediateScenarioPerformance, MTU, Latency & Tools
Answer
Situation read → Usually not, unless it exhausts ephemeral ports on a client.
What I'd do →
- Count states:
ss -sandss -tan state time-wait | wc -l - TIME_WAIT lasts 60 seconds on Linux and protects against late packets
- The real problem is port exhaustion on a client making many outbound connections to one destination
- Widen the range:
sysctl -w net.ipv4.ip_local_port_range="10240 65535" - Use keep-alive and connection pooling instead of tweaking
tcp_tw_reuse
Why → TIME_WAIT is a feature, and fewer short connections is the actual fix.
Interview tip → Say never enable the removed tcp_tw_recycle.
More on Performance, MTU, Latency & Tools
Latency, bandwidth and throughput: what is the difference and why does it matter?BeginnerWhen do you use ping, traceroute and mtr?BeginnerWhat is MTU and what is the usual value?BeginnerHow do you check what is listening on a port and who is connected?BeginnerHow do you measure where time goes in a slow HTTP request?BeginnerWhat does tcpdump do and what are the first filters you use?Beginner