Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitff79b5b

Browse files
Increase default effective_io_concurrency to 16
The default effective_io_concurrency has been 1 since it was introducedinb7b8f0b. Referencing the associated discussion [1], itseems 1 was chosen as a conservative value that seemed unlikely to causeregressions.Experimentation on high latency cloud storage as well as fast, localnvme storage (see Discussion link) shows that even slightly highervalues improve query timings substantially. 1 actually performs worsethan 0 [2]. With effective_io_concurrency 1, we are not prefetchingenough to avoid I/O stalls, but we are issuing extra syscalls.The new default is 16, which should be more appropriate for commonhardware while still avoiding flooding low IOPs devices with I/Orequests.[1]https://www.postgresql.org/message-id/flat/FDDBA24E-FF4D-4654-BA75-692B3BA71B97%40enterprisedb.com[2]https://www.postgresql.org/message-id/CAAKRu_Zv08Cic%3DqdCfzrQabpEXGrd9Z9UOW5svEVkCM6%3DFXA9g%40mail.gmail.comReviewed-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/CAAKRu_Z%2BJa-mwXebOoOERMMUMvJeRhzTjad4dSThxG0JLXESxw%40mail.gmail.com
1 parentaf71731 commitff79b5b

File tree

3 files changed

+18
-24
lines changed

3 files changed

+18
-24
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2574,39 +2574,33 @@ include_dir 'conf.d'
25742574
</term>
25752575
<listitem>
25762576
<para>
2577-
Sets the number of concurrentdisk I/O operations that
2577+
Sets the number of concurrentstorage I/O operations that
25782578
<productname>PostgreSQL</productname> expects can be executed
25792579
simultaneously. Raising this value will increase the number of I/O
2580-
operations that any individual <productname>PostgreSQL</productname> session
2581-
attempts to initiate in parallel. The allowed range is 1 to 1000,
2582-
or zero to disable issuance of asynchronous I/O requests. Currently,
2583-
this setting only affects bitmap heap scans.
2580+
operations that any individual <productname>PostgreSQL</productname>
2581+
session attempts to initiate in parallel. The allowed range is
2582+
<literal>1</literal> to <literal>1000</literal>, or
2583+
<literal>0</literal> to disable issuance of asynchronous I/O requests.
2584+
The default is <literal>16</literal> on supported systems, otherwise
2585+
<literal>0</literal>.
25842586
</para>
25852587

25862588
<para>
2587-
For magnetic drives, a good starting point for this setting is the
2588-
number of separate
2589-
drives comprising a RAID 0 stripe or RAID 1 mirror being used for the
2590-
database. (For RAID 5 the parity drive should not be counted.)
2591-
However, if the database is often busy with multiple queries issued in
2592-
concurrent sessions, lower values may be sufficient to keep the disk
2593-
array busy. A value higher than needed to keep the disks busy will
2594-
only result in extra CPU overhead.
2595-
SSDs and other memory-based storage can often process many
2596-
concurrent requests, so the best value might be in the hundreds.
2589+
Higher values will have the most impact on higher latency storage
2590+
where queries otherwise experience noticeable I/O stalls and on
2591+
devices with high IOPs. Unnecessarily high values may increase I/O
2592+
latency for all queries on the system
25972593
</para>
25982594

25992595
<para>
2600-
Asynchronous I/O requires that the operating system supports issuing
2601-
read-ahead advice. If there is no operating system support then
2602-
setting this parameter to anything but zero will result in an error.
2596+
On systems without prefetch advice support, attempting to configure
2597+
any value other than <literal>0</literal> will error out.
26032598
</para>
26042599

26052600
<para>
2606-
The default is 1 on supported systems, otherwise 0. This value can
2607-
be overridden for tables in a particular tablespace by setting the
2608-
tablespace parameter of the same name (see
2609-
<xref linkend="sql-altertablespace"/>).
2601+
This value can be overridden for tables in a particular tablespace by
2602+
setting the tablespace parameter of the same name (see <xref
2603+
linkend="sql-altertablespace"/>).
26102604
</para>
26112605
</listitem>
26122606
</varlistentry>

‎src/backend/utils/misc/postgresql.conf.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
# - I/O -
199199

200200
#backend_flush_after = 0# measured in pages, 0 disables
201-
#effective_io_concurrency =1# 1-1000; 0 disables prefetching
201+
#effective_io_concurrency =16# 1-1000; 0 disables prefetching
202202
#maintenance_io_concurrency = 10# 1-1000; 0 disables prefetching
203203
#io_combine_limit = 128kB# usually 1-32 blocks (depends on OS)
204204

‎src/include/storage/bufmgr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ extern PGDLLIMPORT bool track_io_timing;
152152

153153
/* only applicable when prefetching is available */
154154
#ifdefUSE_PREFETCH
155-
#defineDEFAULT_EFFECTIVE_IO_CONCURRENCY1
155+
#defineDEFAULT_EFFECTIVE_IO_CONCURRENCY16
156156
#defineDEFAULT_MAINTENANCE_IO_CONCURRENCY 10
157157
#else
158158
#defineDEFAULT_EFFECTIVE_IO_CONCURRENCY 0

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp