diff options
author | Robert Haas <rhaas@postgresql.org> | 2010-06-23 21:54:13 +0000 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2010-06-23 21:54:13 +0000 |
commit | d8cd283a08fe87579e3603eaa8fba4d1eca6a8ca (patch) | |
tree | c4773cfe409540fd14d1d119dcf1f9e571bec37f /doc/src | |
parent | c1b617987d51ab244b07c9cbd01baee6ea3e786a (diff) | |
download | postgresql-d8cd283a08fe87579e3603eaa8fba4d1eca6a8ca.tar.gz postgresql-d8cd283a08fe87579e3603eaa8fba4d1eca6a8ca.zip |
Add TCP keepalive support to libpq.
This adds four additional connection parameters to libpq: keepalives,
keepalives_idle, keepalives_count, and keepalives_interval.
keepalives default to on, per discussion, but can be turned off by
specifying keepalives=0. The remaining parameters, where supported,
can be used to adjust how often keepalives are sent and how many
can be lost before the connection is broken.
The immediate motivation for this patch is to make sure that
walreceiver will eventually notice if the master reboots without
closing the connection cleanly, but it should be helpful in other
cases as well.
Tollef Fog Heen, Fujii Masao, and me.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/libpq.sgml | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index d3a22181825..11161d993f5 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.308 2010/06/17 16:03:30 tgl Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.309 2010/06/23 21:54:13 rhaas Exp $ --> <chapter id="libpq"> <title><application>libpq</application> - C Library</title> @@ -280,6 +280,57 @@ </listitem> </varlistentry> + <varlistentry id="libpq-keepalives" xreflabel="keepalives"> + <term><literal>keepalives</literal></term> + <listitem> + <para> + Controls whether TCP keepalives are used. The default value is 1, + meaning on, but you can change this to 0, meaning off, if keepalives + are not wanted. This parameter is ignored for connections made via + a Unix-domain socket. + </para> + </listitem> + </varlistentry> + + <varlistentry id="libpq-keepalives-idle" xreflabel="keepalives_idle"> + <term><literal>keepalives_idle</literal></term> + <listitem> + <para> + On systems that support the <symbol>TCP_KEEPIDLE</symbol> socket + option, specifies the number of seconds between sending keepalives + on an otherwise idle connection. A value of zero uses the system + default. This parameter is ignored for connections made via a + Unix-domain socket, or if keepalives are disabled. + </para> + </listitem> + </varlistentry> + + <varlistentry id="libpq-keepalives-interval" xreflabel="keepalives_interval"> + <term><literal>keepalives_interval</literal></term> + <listitem> + <para> + On systems that support the <symbol>TCP_KEEPINTVL</symbol> socket + option, specifies how long, in seconds, to wait for a response to a + keepalive before retransmitting. A value of zero uses the system + default. This parameter is ignored for connections made via a + Unix-domain socket, or if keepalives are disabled. + </para> + </listitem> + </varlistentry> + + <varlistentry id="libpq-keepalives-count" xreflabel="keepalives_count"> + <term><literal>keepalives_count</literal></term> + <listitem> + <para> + On systems that support the <symbol>TCP_KEEPCNT</symbol> socket + option, specifies how many keepalives can be lost before the + connection is considered dead. A value of zero uses the system + default. This parameter is ignored for connections made via a + Unix-domain socket, or if keepalives are disabled. + </para> + </listitem> + </varlistentry> + <varlistentry id="libpq-connect-tty" xreflabel="tty"> <term><literal>tty</literal></term> <listitem> |