3 ms·
> If the other system disappeared forever, and there were no timeout, that socket would be held open forever. There is actually a more "gracefully degrading" s
by ambrop7 10y ago
> If the other system disappeared forever, and there were no timeout, that socket would be held open forever.
There is actually a more "gracefully degrading" solution, to keep those connections around potentially indefinitely or with a very long timeout, but to recycle them if the memory is needed for new connections. Seems like Linux supports this for TIME-WAIT but is not enabled by default (sys.net.ipv4.tcp_tw_recycle).
Actually lwIP does such recycling and it can even kill active connections - if there's no memory for a new connection it will try to kill connections in order: TIME-WAIT, LAST-ACK, CLOSING, active connections (incl. FIN-WAIT-2).
- takeda 10y agoI would highly recommend to not use that setting it solves one problem and could introduce other, harder to debug problems. Especially if a load balancer or NAT is on the way. With this setting Linux no longer follows RFC and there is a risk that it could confuse packets from different connections. It falls back to tcp timestamp from PAWS, but often people disable timestamp as well.