Interview Prep/Networking/Sockets, ports, TIME_WAIT and conntrack

`ss -tn` shows one client connection with a large and growing `Send-Q`, and the app's write calls block.

IntermediateTroubleshootingSockets, ports, TIME_WAIT and conntrack
Answer

Likely causes → On an established socket, Send-Q is data not yet ACKed by the peer. A growing value means the receiver is slow (advertising a zero or tiny window because its app isn't reading), or the path is losing packets.

Diagnose →

ss -tni dst <client-ip>          # check snd_wnd / rcv_space / retrans / rto
sudo tcpdump -ni eth0 host <client-ip> -c 50 | grep -E 'win 0|win [0-9]{1,3},'

win 0 from the client = zero window (receiver problem). Retransmits with a normal window = network loss.

Fix → Fix the slow consumer on the client side, or apply per-connection write timeouts on the server so one slow client can't tie up a worker (nginx send_timeout, app-level write deadlines).

Prevent → Use non-blocking writes with deadlines, and protect against slow readers with timeouts at the proxy layer.

All Networking questions Roadmap: Networking for DevOps

More on Sockets, ports, TIME_WAIT and conntrack