Operating System - HP-UX
1837520 Members
3592 Online
110117 Solutions
New Discussion

Re: How to release sockets

 
sid_22
Advisor

How to release sockets

Hi

We have a parameter system which lasts more than 15 minute so that the system releases the socket after 15 minutes (for Aix the parameter is closed wait), it is a parameter of the core of HPUX system. We want to reduce this default value to have a maximum of 2 or 4 seconds .

Please help you have a solution for this problem

Thanks
6 REPLIES 6
Steve Steel
Honored Contributor

Re: How to release sockets

Hi


Should be ndd

see man ndd

The parameter tcp_keepalive_interval determines the amount of time that TCP waits for an idle connection with no unacknowledged data before sending keepalive packets.


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Senthil Kumar .A_1
Honored Contributor

Re: How to release sockets

Hi,

Try ..

ndd â  set /dev/tcp tcp_fin_wait_2_timeout 60000

To make the change permanent:
Modify /etc/rc.config.d/ndd.conf by adding the following line:
TRANSPORT_NAME[0]=tcp
NDD_NAME[0]=tcp_fin_wait_2_timeout
NDD_VALUE[0]=60000

make sure .. the 0 in [0] is repalced by the last number that follows the existing sequence.

60000 millisec = 1 minute.

regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Tiziano Contorno _
Valued Contributor

Re: How to release sockets

If you see hanging CLOSE_WAIT sockets it means the client didn't send the proper last ack. You have to manually kill them with ndd if you are running low on sockets.

I do not remember any tunable parameter for CLOSE_WAIT, I had to write a ndd script to kill sockets in CLOSE_WAIT...

Attached a simple TCP connection diagram.
Senthil Kumar .A_1
Honored Contributor

Re: How to release sockets

Hi in my previous reponse,

please replace use tcp_time_wait_interval instead of tcp tcp_fin_wait_2_timeout ,


so the actual procedure should be..

ndd -set /dev/tcp tcp_time_wait_interval 60000

To make the change permanent:
Modify /etc/rc.config.d/ndd.conf by adding the following line:
TRANSPORT_NAME[0]=tcp
NDD_NAME[0]=tcp_time_wait_interval
NDD_VALUE[0]=60000

make sure .. the 0 in [0] is repalced by the last number that follows the existing sequence.

60000 millisec = 1 minute.

regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
sid_22
Advisor

Re: How to release sockets

Thanks you all for your response. We will try
rick jones
Honored Contributor

Re: How to release sockets

tcp_time_wait_interval will only control how long a connection remains in TIME_WAIT

tcp_keepalive_interval is how long before keepalives start on an established connection, it will wait tcp_ip_abort_interval for a reply to the keepalive probes.

tcp_keepalive_detached_interval is how long before keepalives start on a connection on which the user has called close() - this is to cull FIN_WAIT_2 connections without IIRC having to resort to the kludge of the fin_wait_2 timeout

if the problem is connections in TIME_WAIT, the solution is NOT to reduce TIME_WAIT but to increase the number of ports being used

please try to be a bit more specific about what you want to do

ftp://ftp.cup.hp.com/dist/networking/briefs/annotated_ndd.txt
there is no rest for the wicked yet the virtuous have no pillows