many tcp connection in close-wait

Hi,
I use solaris Unix .
I find there is some problem in application and it generate many "close-wait" tcp connect and stay in the server . it is generate by process id 7740

root@XX # netstat -an | grep CLOSE_WAIT | wc -l
285
 
root@XX # netstat -an | grep CLOSE_WAIT
10.158.35.4.34805    10.158.35.5.32924    48684      0 49640      0 CLOSE_WAIT
10.158.35.4.40989    10.158.35.4.40962    49640      0 49640      0 CLOSE_WAIT
 
 
root@XX # /usr/local/bin/lsof -i:34805
COMMAND    PID    USER   FD   TYPE        DEVICE SIZE/OFF NODE NAME
XXX 7740 user   87u  IPv4 0x30004ce4c48   0t1500  TCP xx-1:34805->xx-2:32924 (CLOSE_WAIT)
 

How can I clear it or any other way to improve .
Please advice

What Solaris release ?
Is this number impacting the service ?
These connections will eventually timeout.

  • in most cases, the close-wait state means the local endpoint (your side - your application) has not properly closed the connection after the activity has actually stopped, in other words - the talk has come to an end.

  • check your source-code to make sure all sockets are closed after they are not needed ;

good luck, and success!

alexandre botao

<< botao {dot} org >>