default value.
This parameter is supported only on systems that support
<symbol>TCP_KEEPINTVL</symbol> or an equivalent socket option, and on
Windows; on other systems, it must be zero.
In sessions connected via a Unix-domain socket, this parameter is
ignored and always reads as zero.
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-tcp-keepalives-count" xreflabel="tcp_keepalives_count">
<term><varname>tcp_keepalives_count</varname> (<type>integer</type>)
<indexterm>
<primary><varname>tcp_keepalives_count</varname> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
Specifies the number of TCP keepalive messages that can be lost before
the server's connection to the client is considered dead.
A value of 0 (the default) selects the operating system's default.
This parameter is supported only on systems that support
<symbol>TCP_KEEPCNT</symbol> or an equivalent socket option (which does not include Windows);
on other systems, it must be zero.
In sessions connected via a Unix-domain socket, this parameter is
ignored and always reads as zero.
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-tcp-user-timeout" xreflabel="tcp_user_timeout">
<term><varname>tcp_user_timeout</varname> (<type>integer</type>)
<indexterm>
<primary><varname>tcp_user_timeout</varname> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
Specifies the amount of time that transmitted data may
remain unacknowledged before the TCP connection is forcibly closed.
If this value is specified without units, it is taken as milliseconds.
A value of 0 (the default) selects the operating system's default.
This parameter is supported only on systems that support
<symbol>TCP_USER_TIMEOUT</symbol> (which does not include Windows); on other systems, it must be zero.
In sessions connected via a Unix-domain socket, this parameter is
ignored and always reads as zero.
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-client-connection-check-interval" xreflabel="client_connection_check_interval">
<term><varname>client_connection_check_interval</varname> (<type>integer</type>)
<indexterm>
<primary><varname>client_connection_check_interval</varname> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
Sets the time interval between optional checks that the client is still
connected, while running queries. The check is performed by polling
the socket, and allows long running queries to be aborted sooner if
the kernel reports that the connection is closed.
</para>
<para>
This option relies on kernel events exposed by Linux, macOS, illumos
and the BSD family of operating systems, and is not currently available
on other systems.
</para>
<para>
If the value is specified without units, it is taken as milliseconds.
The default value is <literal>0</literal>, which disables connection
checks. Without connection checks, the server will detect the loss of
the connection only at the next interaction with the socket, when it
waits for, receives or sends data.
</para>
<para>
For the kernel itself to detect lost TCP connections reliably and within
a known timeframe in all scenarios including network failure, it may
also be necessary to adjust the TCP keepalive settings of the operating
system, or the <xref linkend="guc-tcp-keepalives-idle"/>,
<xref linkend="guc-tcp-keepalives-interval"/> and
<xref linkend="guc-tcp-keepalives-count"/> settings of
<productname>PostgreSQL</productname>.