Operating System - HP-UX
1829596 Members
2050 Online
109992 Solutions
New Discussion

Re: FIN_WAIT_2 ???? state for TCP connections

 
Eric Guerizec
Frequent Advisor

FIN_WAIT_2 ???? state for TCP connections

Hello,
I use Sybase 11.5.1 on HP-UX 11. Sometimes, after restarting sybase
and using netstat command, I found somme connections in FIN_WAIT_2 state.
It seems to me that tcp_keepalive_detached_interval timer is uses to
terminate FIN_WAIT_2 connection. The value of this timer is 120000
(2 minutes). So why I already have FIN_WAIT_2 connections after one hour
and more?

Thanks for your help.

Eric
6 REPLIES 6
Stefan Farrelly
Honored Contributor

Re: FIN_WAIT_2 ???? state for TCP connections


The tcp connection is probably still being held open at the other end - ie. someones PC or another server. You should be able to trackdown its IP address using netstat -a. If you then reboot the remote device or shut the app down the FIN_WAIT_2 should disappear. Only other choice is to use ndd to kill it from the HP end;

ndd -get /dev/tcp tcp_status (and grep for FIN_WAIT_2)

then to kill it;

ndd -set /dev/tcp tcp_discon 0x

Im from Palmerston North, New Zealand, but somehow ended up in London...
James R. Ferguson
Acclaimed Contributor

Re: FIN_WAIT_2 ???? state for TCP connections

Hi:

Have you verified that your default is truly 2-minutes (120000)?; thusly:

# ndd -get /dev/tcp tcp_keepalive_detached_interval

Also, as you are probably aware, you should specify permanent changes in '/etc/rc.config.d/nddconf'.

...JRF...
Philip Chan_1
Respected Contributor

Re: FIN_WAIT_2 ???? state for TCP connections

Hi Eric,

These FIN_WAIT_2 connections, were they came from the dataserver or the backupserver process? you can run "netstat -a|grep FIN_WAIT", then look at the port number to see whether these were dataserver or backupserver connections.

If these FIN_WAIT_2 connections were caused by backupserver, then restarting dataserver won't help. You will have to kill off all "sybmulbuf" process (childs of backupserver) then restart backupserver for clearing these FIN_WAIT_2 connections.

Rgds,
Philip
Eric Guerizec
Frequent Advisor

Re: FIN_WAIT_2 ???? state for TCP connections

Everybody, thanks for your help.

Yes, in my HP-UX system
tcp_keepalive_detached_interval is set to 2 minutes.
The FIN_WAIT_2 connections came from the dataserver.
I know that machines at the other end are PC.
I read in ftp://ftp.cup.hp.com/dist/networking/briefs/annotated_ndd.txt
file that modifying tcp_discon could in theory
crash the system! Is it true?


Eric
James R. Ferguson
Acclaimed Contributor

Re: FIN_WAIT_2 ???? state for TCP connections

Hi Eric:

I found TKB (document #KBRC00001353 ("How do I clear idle fin_wait_2 connections?") which may be what you need. Here's its content:

/begin_quote/

There is an ndd parameter, post-patch PHNE_19375/11.0, that is called tcp_fin_wait_2_timeout. This parameter sets the fin_wait_2 timer on 11.X to stop idle fin_wait_2 connections. It will not survive a reboot, so modification of the /etc/rc.config.d/nddconf is a necessary.

It specifies an interval, in milliseconds, after which the TCP will be unconditionally killed. An appropriate reset segment will be sent when the connection is killed.

The default for tcp_fin_wait_2_timeout is 0, which allows the connection to live forever, as long as the far side continues to answer keepalives.

To enable the tcp_fin_wait_2 timer to timeout do the following:

1. To get the current value (0 is turned off):
# ndd -get /dev/tcp tcp_fin_wait_2_timeout 0

2. To set the value to 20 min's:
# ndd -set /dev/tcp tcp_fin_wait_2_timeout 1200000

3. Check the setting:
# ndd -get /dev/tcp tcp_fin_wait_2_timeout 1200000

Note: (1000 ms in 1 second) * (60 seconds) * (20 minutes)= 1200000 ms. 20 minutes is just an example but probably a good selection.

This will not survive a reboot, so you need to update /etc/rc.config.d/nddconf with the parameter so that it will be set at boot time.

TRANSPORT_NAME[0]=tcp
NDD_NAME[0]=tcp_fin_wait_2_timeout
NDD_VALUE[0]=1200000

NOTE: patches may be superceded, verify your patch levels via the patch database on the IT resource Center.

For more information regarding Transmission Control Protocols See RFC 793

/end_quote/

...JRF...
Eric Guerizec
Frequent Advisor

Re: FIN_WAIT_2 ???? state for TCP connections

Thanks James!
I think the use of tcp_fin_wait_2_timeout timer
is a good solution for me.

For all, sorry I can't assign points for your responses.
Netscape 6 returns an error 404 (I send a mail to ITRC support)
and my ITRC login doesn't work with Explorer.
:o(
I'll try again later.