The app logs `write: broken pipe` (or `EPIPE`) on some responses.
BeginnerTroubleshootingSockets, ports, TIME_WAIT and conntrack
Answer
Likely causes → The app wrote to a socket the peer had already closed: the client gave up (timeout, user navigated away), or a proxy/LB in between closed the connection because its timeout was shorter than the app's processing time.
Diagnose →
# correlate with proxy logs: nginx 499 or ALB 460 at the same timestamps
grep ' 499 ' /var/log/nginx/access.log | tail
Measure how long the failing requests took versus each layer's timeout.
Fix → Occasional EPIPE from impatient clients is normal; log it at a lower level. If it correlates with slow endpoints, speed them up or align timeouts so each inner layer times out before the outer one.
Prevent → Define a timeout budget from client → LB → proxy → app → DB, decreasing at each hop.
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.`Intermediate`ss -ltn` shows the listener for port 8080 with `Recv-Q 129` and `Send-Q 128`, and clients hang on connect.Advanced