1834425 Members
2281 Online
110067 Solutions
New Discussion

FIN_WAIT_2

 
meison_1
New Member

FIN_WAIT_2

Hello all!

The OS is HP-UX 11.11

I have a problem with TCP connection.

When i contact web page(connected DB..) and run "netstat" on the server i see FIN_WAIT_2!!!

And If i close browser, disappear FIN_WAIT_2 message!!

Number of Fin_WAIT_2 message run into about 4000!!

How i can configure the timeout for the FIN_WAIT_2 connections?

Thanks to all!!!!


2 REPLIES 2
David de Beer
Valued Contributor

Re: FIN_WAIT_2

How do I clear or prevent too many fin_wait_2 connections?
DocId: KBRC00015664 Updated: 5/30/06 12:57:00 PM
PROBLEM


Too many idle fin_wait_2 connections. How can I get them cleared out or to
time out?

CONFIGURATION
hp9000 hp-ux 11.X
RESOLUTION

There is an ndd parameter, post-patch PHNE_19375/11.0 and included in 11i,
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.

tcp_fin_wait_2_timeout specifies an interval, in milliseconds, after which the
TCP connection 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 10 minutes:
# ndd -set /dev/tcp tcp_fin_wait_2_timeout 600000

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


Note: (1000 ms in 1 second) * (60 seconds) * (10 minutes)= 600000 ms.
10 minutes is just an example but probably a good selection. Using a
setting less than 10 minutes is not recommended by HP and may cause data loss
with half-closed TCP connections.


Using the ndd on command line 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]=600000

Use this commend to read the nddconf file and implement the ndd's:

# ndd -c


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

rick jones
Honored Contributor

Re: FIN_WAIT_2

If closing the browser means the FIN_WAIT_2 state TCP endpoint on the server goes away, it means your browser is broken. FIN_WAIT_2 means we've sent a FINished segment to the remote, and have received a TCP-level ACK of that FIN. For HTTP if the server has initiated close of the connection there is virtually no reason for the browser to keep its end of the connection open. That the browser has not closed its end of the connection is a bug.

Now, someone else has already mentioned the tcp_fin_wait_2 kludge - that should not be used to paper-over broken clients. Use it only as long as it takes to get the clients fixed.

Also, while it may seem like 4000 of these things is a lot, as far as the TCP stack is concerned, it can deal with 4000 of these things without any trouble at all.
there is no rest for the wicked yet the virtuous have no pillows