summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2023-04-08 11:04:49 +1200
committerThomas Munro <tmunro@postgresql.org>2023-04-08 16:35:07 +1200
commitd4e71df6d757fd21c363164a3a4d3b5681462662 (patch)
tree27db4af292830160ecfe4789645f87d0e5a1daea /doc
parentfaeedbcefd40bfdf314e048c425b6d9208896d90 (diff)
downloadpostgresql-d4e71df6d757fd21c363164a3a4d3b5681462662.tar.gz
Add io_direct setting (developer-only).
Provide a way to ask the kernel to use O_DIRECT (or local equivalent) where available for data and WAL files, to avoid or minimize kernel caching. This hurts performance currently and is not intended for end users yet. Later proposed work would introduce our own I/O clustering, read-ahead, etc to replace the facilities the kernel disables with this option. The only user-visible change, if the developer-only GUC is not used, is that this commit also removes the obscure logic that would activate O_DIRECT for the WAL when wal_sync_method=open_[data]sync and wal_level=minimal (which also requires max_wal_senders=0). Those are non-default and unlikely settings, and this behavior wasn't (correctly) documented. The same effect can be achieved with io_direct=wal. Author: Thomas Munro <thomas.munro@gmail.com> Author: Andres Freund <andres@anarazel.de> Author: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Reviewed-by: Justin Pryzby <pryzby@telsasoft.com> Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Discussion: https://postgr.es/m/CA%2BhUKGK1X532hYqJ_MzFWt0n1zt8trz980D79WbjwnT-yYLZpg%40mail.gmail.com
Diffstat (limited to 'doc')
-rw-r--r--doc/src/sgml/config.sgml33
1 files changed, 32 insertions, 1 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 1966ecc162..091a79d4f3 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3172,7 +3172,6 @@ include_dir 'conf.d'
</listitem>
</itemizedlist>
<para>
- The <literal>open_</literal>* options also use <literal>O_DIRECT</literal> if available.
Not all of these choices are available on all platforms.
The default is the first method in the above list that is supported
by the platform, except that <literal>fdatasync</literal> is the default on
@@ -11256,6 +11255,38 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
</listitem>
</varlistentry>
+ <varlistentry id="guc-io-direct" xreflabel="io_direct">
+ <term><varname>io_direct</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>io_direct</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Ask the kernel to minimize caching effects for relation data and WAL
+ files using <literal>O_DIRECT</literal> (most Unix-like systems),
+ <literal>F_NOCACHE</literal> (macOS) or
+ <literal>FILE_FLAG_NO_BUFFERING</literal> (Windows).
+ </para>
+ <para>
+ May be set to an empty string (the default) to disable use of direct
+ I/O, or a comma-separated list of operations that should use direct I/O.
+ The valid options are <literal>data</literal> for
+ main data files, <literal>wal</literal> for WAL files, and
+ <literal>wal_init</literal> for WAL files when being initially
+ allocated.
+ </para>
+ <para>
+ Some operating systems and file systems do not support direct I/O, so
+ non-default settings may be rejected at startup or cause errors.
+ </para>
+ <para>
+ Currently this feature reduces performance, and is intended for
+ developer testing only.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="guc-post-auth-delay" xreflabel="post_auth_delay">
<term><varname>post_auth_delay</varname> (<type>integer</type>)
<indexterm>