Keep Alive

2007-12-25 8:47:00

Hi managers !

My original question was:

 -------------------------

QUESTION :

My customer has asked me about the "keepalive" function of TCP/IP.

Specifically, he wants to know if it is configurable for different times

(send a packet more often than 2 hours, the default).

For now, I've been said that...

============================================================================

==============

The "keepalive " function has to do with sockets. Sockets are communication

channels (ports on a specific host) that enable unrelated processes to

exchange data locally and over networks. A single socket is one endpoint of

the two-way communications channel.

A programmer can set certain options on a socket with the setsockopt()

routine. This routine accepts the SO_KEEPALIVE parameter. This parameter

enables the periodic transmission of messages to a connected socket. If the

connected socket fails to respond to these

messages, the connection is broken and processes using the socket are

notified with a SIGPIPE signal.

============================================================================

==============

But I'm not a programmer !

I can't tell from the documentation if the 120 minute interval is settable

in the kernel (then rebuild) or not. I've been said that SunOS allows to set

it for a smaller interval. It is important to my customer that he can do

this. Is it settable, or do we (or OSF) have plans

to make it settable?

For AIX 3.2, I have this ANSWER:

========================================================

     You could configure the 120 minute interval upgrading to AIX ver 3.2.

 Although this is not documented, AIX ver 3.2 supports user-confugured

 keepalive interval.

     This is accomplished with the "no"(Network Option) command. The "no"

command sets and displays kernel network options. This command must be run

after each startup or after the network has been changed. Issuing the "no

 -a" command from the shell prompt displays the current settings. An example

partial listing is :

          ...

          tcp_keepintvl = 150

          tcp_keepidle = 14400

          ...

========================================================

But what about SunOS ?

My original answer is:

 ----------------------

The answer is coming from the Sybase Release bulletin for SQL Server 4.9:

"

5.3.1. Adjusting Network Client Time-out for SunOS 4.1.x and Above.

       The length of the time-out period in SunOS 4.1.x is adjusted

       through three symbolic constants. These constants can be found

       in /sys/netinet/tcp_timer.h. Adjustment of this time-out

       requires that you modify this file and rebuild the kernel. Make

       a backup copy of this file before you modify it.

       For best server performance, shorten the time-out period to one

       minute by changing the constants as shown below:

       from

               #define TCPTV_KEEP_IDLE (120*60*PR_SLOWHZ)

       to

               #define TCPTV_KEEP_IDLE ( 2*60*PR_SLOWHZ)

       from

               #define TCPTV_KEEPINTVL ( 75*PR_SLOWHZ)

       to

               #define TCPTV_KEEPINTVL ( 60*PR_SLOWHZ)

       and from

               #define TCPTV_KEEPCNT 8

       to

               #define TCPTV_KEEPCNT 1

       The exact format of these source lines may vary slightly in

       different SunOS releases. The value of TCPTV_KEEP_IDLE determines

       the total time to wait after making a connection before probing

       the connection for activity. We reduced it from two hours to two

       minutes. We also reduced TCPTV_KEEPCNT from ten minutes to one

       minute. The total time-out interval is the product of

       TCPTV_KEEPINTVL and TCPTV_KEEPCNT. One PR_SLOWHZ time unit

       is roughly equal to one second.

"

It's working very well. It's very usefull for people who are working on PC

and running the "Q+E" application.

"Q+E" sometimes reboots the PC but the link still exists towards the SQL

server (SUN SS10 for example).

The link stay openned for a while that can reach 2 hours by default or 2

MINUTES if you install these changes.

If many people reboot their PCs several times, the maximum number of

SQL-connection can be quickly reached.

Thanks to:

     Pierre.Pertsov@sybase.com

     guycole@netcom.com

     lledo@sphinx.cea.fr

Comments

Got something to say?

You must be logged in to post a comment.