Operating System - HP-UX
1834628 Members
3415 Online
110069 Solutions
New Discussion

Re: Impact of socket caching to CLOSE_WAITs

 
Pavel Moravec
Occasional Advisor

Impact of socket caching to CLOSE_WAITs

Hi all,
our application does not close sockets when they are being opened and closed in a very short time (within one milisecond). This faulty behaviour of the application causes under those circumstances many sockets remaining forever in CLOSE_WAIT status.

The application will be definitely fixed, but meantime I am thinking of a workaround. Would enabling socket caching (e.g. "ndd -set /dev/sockets socket_caching_tcp 512" or set it permanently under/etc/rc.config.d/nddconf) help somehow? Now the hashing is disabled.

Thanks in advance for your answers.
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: Impact of socket caching to CLOSE_WAITs

Shalom,

The default behavior for applications not active is 60 seconds.Is the application somehow still active?

To provide guidance on your parameter, change would require a look at your nddconf file.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Pavel Moravec
Occasional Advisor

Re: Impact of socket caching to CLOSE_WAITs

Thanks for the response.

The application is still alive, accepting new TCP connections, also dropping them etc. The only problem is that under some circumstances it forgets to drop a TCP connection.

nddconf (without commented lines):

TRANSPORT_NAME[0]=ip
NDD_NAME[0]=ip_ire_gw_probe
NDD_VALUE[0]=0

TRANSPORT_NAME[1]=tcp
NDD_NAME[1]=tcp_keepalive_interval
NDD_VALUE[1]=120000

rick jones
Honored Contributor

Re: Impact of socket caching to CLOSE_WAITs

That is a facinating bug to have in a program. Describing it further here is probably out of scope though, even though I am curious to know more about it.

I believe socket caching will not affect your situation one way or the other.

Short of terminating and relaunching processes, the only other recourse until you can get your application fixed _might_ be the tcp_discon kludge.
there is no rest for the wicked yet the virtuous have no pillows
Laurent Menase
Honored Contributor

Re: Impact of socket caching to CLOSE_WAITs

Hi Pavel,

Socket caching will not help, at all.

If the symptom you have is that you can't get any more fildescriptor, then ndd tcp_discon_by_addr will be of no help,
If the symptom you have is that all ephemeral ports - or anonymous ports- are used - ports between 49152 and 65535-
- ports between , then tcp_discon_by_addr can help, if you can identify the socket you should close. Or the other solution would be in that case to raise the number of ephemeral ports lowering tcp_smallest_anon_port.
- don't lower it too much-

Pavel Moravec
Occasional Advisor

Re: Impact of socket caching to CLOSE_WAITs

Socket caching has no impact to the numbers of sockets in CLOSE_WAIT status.