`ss -ltn` shows the listener for port 8080 with `Recv-Q 129` and `Send-Q 128`, and clients hang on connect.
AdvancedTroubleshootingSockets, ports, TIME_WAIT and conntrack
Answer
Likely causes → For a listening socket, Recv-Q is the current accept queue length and Send-Q is its maximum. Recv-Q above Send-Q means the accept queue is full: the handshake completed in the kernel, but the app isn't calling accept() fast enough (event loop blocked, all worker threads busy, GC pause). Further final ACKs are dropped and clients retransmit.
Diagnose →
watch -n1 "ss -ltn 'sport = :8080'"
nstat -az TcpExtListenOverflows TcpExtListenDrops
top -H -p $(pgrep -f myapp) # are all workers pegged?
Fix → Fix the slow consumer first (more workers, non-blocking I/O, offload slow work). Then raise the backlog: the effective value is min(listen() backlog, net.core.somaxconn), so increase both.
sudo sysctl -w net.core.somaxconn=4096
# and in the app, e.g. gunicorn --backlog 4096
Prevent → Export ListenOverflows and alert on any increase; load test with realistic concurrency.
More on Sockets, ports, TIME_WAIT and conntrack
`dmesg` is full of `nf_conntrack: nf_conntrack: table full, dropping packet` and new connections randomly time out.Intermediate`ss -s` on a reverse proxy shows 40,000 sockets in `TIME_WAIT`. Is that a problem?BeginnerAn app server's `CLOSE_WAIT` count grows steadily until the service logs `Too many open files`.IntermediateLogs show `accept4(): Too many open files` and the service stops accepting connections.Beginner`dmesg` shows `TCP: request_sock_TCP: Possible SYN flooding on port 443. Sending cookies.`IntermediateA blog post told you to set `net.ipv4.tcp_tw_recycle=1`, but `sysctl` returns `cannot stat /proc/sys/net/ipv4/tcp_tw_recycle`.Beginner