1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Introduce a maintenance_io_concurrency setting.

Introduce a GUC and a tablespace option to control I/O prefetching, much
like effective_io_concurrency, but for work that is done on behalf of
many client sessions.

Use the new setting in heapam.c instead of the hard-coded formula
effective_io_concurrency + 10 introduced by commit 558a9165e0.  Go with
a default value of 10 for now, because it's a round number pretty close
to the value used for that existing case.

Discussion: https://postgr.es/m/CA%2BhUKGJUw08dPs_3EUcdO6M90GnjofPYrWp4YSLaBkgYwS-AqA%40mail.gmail.com
This commit is contained in:
Thomas Munro
2020-03-16 12:31:34 +13:00
parent b09ff53667
commit fc34b0d9de
12 changed files with 109 additions and 23 deletions

View File

@ -2229,6 +2229,26 @@ include_dir 'conf.d'
</listitem>
</varlistentry>
<varlistentry id="guc-maintenance-io-concurrency" xreflabel="maintenance_io_concurrency">
<term><varname>maintenance_io_concurrency</varname> (<type>integer</type>)
<indexterm>
<primary><varname>maintenance_io_concurrency</varname> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
Similar to <varname>effective_io_concurrency</varname>, but used
for maintenance work that is done on behalf of many client sessions.
</para>
<para>
The default is 10 on supported systems, otherwise 0. This value can
be overridden for tables in a particular tablespace by setting the
tablespace parameter of the same name (see
<xref linkend="sql-altertablespace"/>).
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-max-worker-processes" xreflabel="max_worker_processes">
<term><varname>max_worker_processes</varname> (<type>integer</type>)
<indexterm>

View File

@ -84,13 +84,16 @@ ALTER TABLESPACE <replaceable>name</replaceable> RESET ( <replaceable class="par
<para>
A tablespace parameter to be set or reset. Currently, the only
available parameters are <varname>seq_page_cost</varname>,
<varname>random_page_cost</varname> and <varname>effective_io_concurrency</varname>.
Setting either value for a particular tablespace will override the
<varname>random_page_cost</varname>, <varname>effective_io_concurrency</varname>
and <varname>maintenance_io_concurrency</varname>.
Setting these values for a particular tablespace will override the
planner's usual estimate of the cost of reading pages from tables in
that tablespace, as established by the configuration parameters of the
that tablespace, and the executor's prefetching behavior, as established
by the configuration parameters of the
same name (see <xref linkend="guc-seq-page-cost"/>,
<xref linkend="guc-random-page-cost"/>,
<xref linkend="guc-effective-io-concurrency"/>). This may be useful if
<xref linkend="guc-effective-io-concurrency"/>,
<xref linkend="guc-maintenance-io-concurrency"/>). This may be useful if
one tablespace is located on a disk which is faster or slower than the
remainder of the I/O subsystem.
</para>

View File

@ -106,13 +106,16 @@ CREATE TABLESPACE <replaceable class="parameter">tablespace_name</replaceable>
<para>
A tablespace parameter to be set or reset. Currently, the only
available parameters are <varname>seq_page_cost</varname>,
<varname>random_page_cost</varname> and <varname>effective_io_concurrency</varname>.
Setting either value for a particular tablespace will override the
<varname>random_page_cost</varname>, <varname>effective_io_concurrency</varname>
and <varname>maintenance_io_concurrency</varname>.
Setting these values for a particular tablespace will override the
planner's usual estimate of the cost of reading pages from tables in
that tablespace, as established by the configuration parameters of the
that tablespace, and the executor's prefetching behavior, as established
by the configuration parameters of the
same name (see <xref linkend="guc-seq-page-cost"/>,
<xref linkend="guc-random-page-cost"/>,
<xref linkend="guc-effective-io-concurrency"/>). This may be useful if
<xref linkend="guc-effective-io-concurrency"/>,
<xref linkend="guc-maintenance-io-concurrency"/>). This may be useful if
one tablespace is located on a disk which is faster or slower than the
remainder of the I/O subsystem.
</para>