clear CLOSE_WAIT status | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

clear CLOSE_WAIT status

UNIX for Advanced & Expert Users


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-02-2006
rein rein is offline
Registered User
 
Join Date: Dec 2004
Last Activity: 31 January 2011, 2:32 PM EST
Location: Zürich
Posts: 151
Thanks: 0
Thanked 1 Time in 1 Post
clear CLOSE_WAIT status

Hi,

I have an application with a bug in it that keeps sockets in CLOSE_WAIT, which eventually freezes the server because the user account it runs under runs out of file handles. We have the bug fixed but can only release the fix with the next release.

Does anyone know how I can clear the sockets in CLOSE_WAIT status? This way I won't have to restart the application server every other day...

We have Red Hat Enterprise 4.

Thanks,

Reinout
Sponsored Links
    #2  
Old 10-03-2006
sumitpandya sumitpandya is offline
Registered User
 
Join Date: Mar 2006
Last Activity: 10 April 2014, 6:20 AM EDT
Location: Ahmedabad
Posts: 137
Thanks: 0
Thanked 0 Times in 0 Posts
You need to look into sysctl document

You can tune many of TCP/IP related parameters from procfs/sysfs
See to document /usr/src/linux/Documentation/networking/ip-sysctl.txt
Example, for TCP there are following files
/proc/sys/net/ipv4/tcp_*
Remember changes in those file will be temperal and will not remain after system reboot. To make it parmenant you need to create "/etc/sysctl.conf" entries. Look man sysctl
Also if you can do socket shutdown then socket close in your application then it also overcome our problem
Sponsored Links
    #3  
Old 10-03-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 31 August 2014, 5:38 PM EDT
Location: NM
Posts: 10,180
Thanks: 275
Thanked 785 Times in 734 Posts
As sumitpandya indicated your code has a problem.

There have been some posts lately about this problem, try searching using the "search" button and "CLOSE_WAIT"
    #4  
Old 10-05-2006
rein rein is offline
Registered User
 
Join Date: Dec 2004
Last Activity: 31 January 2011, 2:32 PM EST
Location: Zürich
Posts: 151
Thanks: 0
Thanked 1 Time in 1 Post
I know the problem is in our code and we have a fix for it but we can't role it out immediately in a production environment. Clearing the CLOSE_WAIT is just an emergency solution, and better then restarting the application servers daily.

We're planning a new release tomorrow that should fix the problem.

The fix is using a multithreaded connection pool instead of openening a new connection per request which in case of a probable memory leak causes the socket to stay occupied while being in CLOSE_WAIT.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Too many CLOSE_WAIT connections Duffs22 Red Hat 2 10-24-2011 06:57 AM
How to remove CLOSE_WAIT in Solaris helplineinc Solaris 2 07-11-2009 06:39 AM
CLOSE_WAIT problem in solaris server mgmk.84 Solaris 2 04-29-2009 10:55 AM
handling CLOSE_WAIT -TCP state matrixmadhan Programming 16 09-16-2006 03:51 AM
remove CLOSE_WAIT connections Livio Solaris 6 02-08-2006 04:21 AM



All times are GMT -4. The time now is 09:54 PM.