Operating System - HP-UX
1843345 Members
3036 Online
110214 Solutions
New Discussion

Re: Too many FIN_WAIT_2 connections

 
Daniel Szponka
Occasional Contributor

Too many FIN_WAIT_2 connections

Hi
I administer an HP9000 L3000 computer that runs HP-UX 11.0 and ARS and gets too may TCP connections.

I would like to reduce the time a connection stays
in the FIN_WAIT_2 state

What parameter would I have too change ?
How to do it and what value would be best ??

Thank you & Regards

Daniels
Unix Forever
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: Too many FIN_WAIT_2 connections

Hi Daniel:

The recommendation is to add this to '/etc/rc.config.d/ndd.conf' so that it is issued upon each reboot. You can also issue the command immediately.

# ndd -set /dev/tcp tcp_fin_wait_2_timeout 660000

The value of 660000 constitutes 11-minutes. HP doesn't recommand a value less than 10-minutes. The units are milliseconds with zero (0) indicating "wait forever".

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: Too many FIN_WAIT_2 connections

FIN_WAIT_2 is a normal state and part of the normal protocol to close a socket connection. However, programming errors in handling this protocol will leave the FIN_WAIT_2 state indefinitely. If the programs are properly written then these may be caused by users that terminate sessions improperly, typically a PC connection that crashes or client programmming errors.

Use ndd to clear these connection problems. NOTE: There is no way to determine whether a program pair (the socket connects them) is still properly waiting, which means that killing this connection may result in data loss. A thorough knowledge of the applications is required to make an informed decision. You may need 20mins before an auto-kill or you may need an hour.

If you are up to date on patches, you can see the current value of the FIN_WAIT-2 timer with:

ndd -get /dev/tcp tcp_fin_wait_2_timeout

But if you get an error then you'll need the latest ndd patch. To set the timer for 60 minutes before killing the FIN_WAIT_2 state, use:

ndd -get /dev/tcp tcp_fin_wait_2_timeout 3600000

This is a transient setting and will not remain after a reboot. To automate this task, edit the file /etc/rc.config.d/nddconf


Bill Hassell, sysadmin
Daniel Szponka
Occasional Contributor

Re: Too many FIN_WAIT_2 connections

Hi JRF

Thank you for your speedy answer

I will try and let you know

Regards

Daniels
Unix Forever
Daniel Szponka
Occasional Contributor

Re: Too many FIN_WAIT_2 connections

Hi Bill

Yes my case is the one where there ara many PC's connected to this appl ARS and when they crash they leave this connections FIN_WAIT_2 forever

I checked the command you gave
me ndd -get and the cuurent value was 0 which means "forever" so I changed it as you told me to 360000 and finally I have a reasonably number of FIN_WAIT_2 connections

Thank you for your help

Regards

Daniels
Unix Forever