Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> In general, sockets sitting a long time in TIME_WAIT would be a
> network problem. That state means the user process already closed
> the socket and the network stack is waiting for the other end to
> acknowledge connection closure. If it's not getting the ACK then
> you have either buggy network code in one kernel or the other, or
> a network-level problem (maybe an overaggressive firewall in
> between?).
Not to discount those possibilities, but I've seen one other cause:
a storm of connection attempts. It could be a DoS attack or a
poorly written client.
-Kevin