aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-01-06 18:28:42 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2021-01-06 18:28:52 -0500
commit9877374bef76ef03923f6aa8b955f2dbcbe6c2c7 (patch)
tree9255038d282a07de135530578d5b365a4aaa18dd /doc/src
parent09cf1d52267644cdbdb734294012cf1228745aaa (diff)
downloadpostgresql-9877374bef76ef03923f6aa8b955f2dbcbe6c2c7.tar.gz
postgresql-9877374bef76ef03923f6aa8b955f2dbcbe6c2c7.zip
Add idle_session_timeout.
This GUC variable works much like idle_in_transaction_session_timeout, in that it kills sessions that have waited too long for a new client query. But it applies when we're not in a transaction, rather than when we are. Li Japin, reviewed by David Johnston and Hayato Kuroda, some fixes by me Discussion: https://postgr.es/m/763A0689-F189-459E-946F-F0EC4458980B@hotmail.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/config.sgml51
1 files changed, 44 insertions, 7 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 425f57901d7..15b94c96c08 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -8310,15 +8310,52 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
</term>
<listitem>
<para>
- Terminate any session with an open transaction that has been idle for
- longer than the specified amount of time. This allows any
- locks held by that session to be released and the connection slot to be reused;
- it also allows tuples visible only to this transaction to be vacuumed. See
- <xref linkend="routine-vacuuming"/> for more details about this.
+ Terminate any session that has been idle (that is, waiting for a
+ client query) within an open transaction for longer than the
+ specified amount of time.
+ If this value is specified without units, it is taken as milliseconds.
+ A value of zero (the default) disables the timeout.
+ </para>
+
+ <para>
+ This option can be used to ensure that idle sessions do not hold
+ locks for an unreasonable amount of time. Even when no significant
+ locks are held, an open transaction prevents vacuuming away
+ recently-dead tuples that may be visible only to this transaction;
+ so remaining idle for a long time can contribute to table bloat.
+ See <xref linkend="routine-vacuuming"/> for more details.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-idle-session-timeout" xreflabel="idle_session_timeout">
+ <term><varname>idle_session_timeout</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>idle_session_timeout</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Terminate any session that has been idle (that is, waiting for a
+ client query), but not within an open transaction, for longer than
+ the specified amount of time.
+ If this value is specified without units, it is taken as milliseconds.
+ A value of zero (the default) disables the timeout.
</para>
+
+ <para>
+ Unlike the case with an open transaction, an idle session without a
+ transaction imposes no large costs on the server, so there is less
+ need to enable this timeout
+ than <varname>idle_in_transaction_session_timeout</varname>.
+ </para>
+
<para>
- If this value is specified without units, it is taken as milliseconds.
- A value of zero (the default) disables the timeout.
+ Be wary of enforcing this timeout on connections made through
+ connection-pooling software or other middleware, as such a layer
+ may not react well to unexpected connection closure. It may be
+ helpful to enable this timeout only for interactive sessions,
+ perhaps by applying it only to particular users.
</para>
</listitem>
</varlistentry>