This is a Linux Networking Question (I think my first question got
nuked because it appeared to be an NT question...)
We are using a Pervasive SQL v.7 Database on a Linux server, our
clients attach to this database via TCP/IP. There is a problem that
can occur with the database: If a client crashes it will take up to
two hours for the server to recognize that the client has crashed and
attempt a reconnect to the client. This is because the default TCP/IP
timeout is set to two hours. (At least this is what Pervasive tells
us, we have not had a client crash yet.(The clients HAVE to be windows
So, if a client crashes it cannot connect to the server for a full two
hours (after coming back up naturally!) until the server times out the
TCP/IP connection. The solution for this (under NT not Linux) is to
edit the registry to modify the keepalive time and then reboot the
machine. At least this is the solution that we were sent by Pervasive.
Apparently (?) this timeout is standard in TCP/IP and most likely in
Linux. What is the default keepalive time and how can it be changed?
(there seems to be no setting of any kind like that in ifconfig)
Will this be a problem with Linux or does Linux handle the connections
in a completly different way?
Basically, what I am asking is how often does the Linux kernel poll
active TCP/IP connections to see if they are up? And, if that time is
(like the mail message below says) the same as NT's two hours, how do
I shorten it???
The body of the (NT oriented) Email from pervasive follows:
Title: TCP/IP Connections Appear in Btrieve Monitor After Workstation
Is Powered Down
Goal: TCP/IP Connections Appear in Btrieve Monitor After Workstation
Is Powered Down
Fact: Pervasive.SQL v7
Fact: TCP/IP Protocol
Symptom: TCP/IP connection remains active to the MicroKernel
engine when a workstation is powered down or rebooted without cleanly
disconnecting from the server.
Cause: By default, the Windows NT Server TCP/IP service will not
poll an inactive TCP/IP connection unless the connection has been idle
for approximately two hours. Thus, if a workstation establishes a
connection with the MicroKernel engine via TCP/IP and is powered down
or rebooted without cleanly disconnecting from the server, no
indication that the connection has failed is given to the MicroKernel
engine for two hours, and therefore the connection remains active to
the MicroKernel engine during that time. You may use the Btrieve
monitor to delete a connection in that state.
Fix: For inactive connections to be detected sooner than the
default two hours, change the Windows NT registry database as follows:
a) Open up the
key using the standard registry editor (REGEDT32.EXE).
b) Add or set the following value: Value name: KeepAliveTime
type: REG_DWORD data: which is a numeric value representing the number
of milliseconds after which "keep alive" messages will be sent across
the network in case of inactive connections.
c) Reboot your machine.
NOTE: The "KeepAliveTime" setting affects the whole TCP/IP protocol
stack not just Pervasive.SQL. This information is also on the
Microsoft Knowledgebase, go to