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

Commit4bc0f16

Browse files
committed
Change default of backend_flush_after GUC to 0 (disabled).
While beneficial, both for throughput and average/worst case latency, ina significant number of workloads, there are other workloads in whichbackend_flush_after can cause significant performance regressions incomparison to < 9.6 releases. The regression is most likely when the hotdata set is bigger than shared buffers, but significantly smaller thanthe operating system's page cache.I personally think that the benefit of enabling backend flush control isconsiderably bigger than the potential downsides, but a fair argumentcan be made that not regressing is more important than improvingperformance/latency. As the latter is the consensus, change the defaultto 0.The other settings introduced in428b1d6 do not have the samepotential for regressions, so leave them enabled.Benchmarks leading up to changing the default have been performed byMithun Cy, Ashutosh Sharma and Robert Haas.Discussion: CAD__OuhPmc6XH=wYRm_+Q657yQE88DakN4=Ybh2oveFasHkoeA@mail.gmail.com
1 parent3303ea1 commit4bc0f16

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,9 +2038,9 @@ include_dir 'conf.d'
20382038
than the OS's page cache, where performance might degrade. This
20392039
setting may have no effect on some platforms. The valid range is
20402040
between <literal>0</literal>, which disables controlled writeback,
2041-
and <literal>2MB</literal>. The default is <literal>128Kb</>on
2042-
Linux, <literal>0</> elsewhere. (Non-default values of
2043-
<symbol>BLCKSZ</symbol>change the default and maximum.)
2041+
and <literal>2MB</literal>. The default is <literal>0</>(i.e. no
2042+
flush control). (Non-default values of <symbol>BLCKSZ</symbol>
2043+
change the maximum.)
20442044
</para>
20452045
</listitem>
20462046
</varlistentry>

‎src/backend/utils/misc/guc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2457,8 +2457,7 @@ static struct config_int ConfigureNamesInt[] =
24572457
GUC_UNIT_BLOCKS
24582458
},
24592459
&backend_flush_after,
2460-
/* see bufmgr.h: OS dependent default */
2461-
DEFAULT_BACKEND_FLUSH_AFTER,0,WRITEBACK_MAX_PENDING_FLUSHES,
2460+
0,0,WRITEBACK_MAX_PENDING_FLUSHES,
24622461
NULL,NULL,NULL
24632462
},
24642463

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@
170170
#max_parallel_workers_per_gather = 2# taken from max_worker_processes
171171
#old_snapshot_threshold = -1# 1min-60d; -1 disables; 0 is immediate
172172
# (change requires restart)
173-
#backend_flush_after = 0# 0 disables,
174-
# default is 128kb on linux, 0 otherwise
173+
#backend_flush_after = 0# 0 disables, default is 0
175174

176175

177176
#------------------------------------------------------------------------------

‎src/include/storage/bufmgr.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,9 @@ extern PGDLLIMPORT int NBuffers;
6060
/* FIXME: Also default to on for mmap && msync(MS_ASYNC)? */
6161
#ifdefHAVE_SYNC_FILE_RANGE
6262
#defineDEFAULT_CHECKPOINT_FLUSH_AFTER 32
63-
#defineDEFAULT_BACKEND_FLUSH_AFTER 16
6463
#defineDEFAULT_BGWRITER_FLUSH_AFTER 64
6564
#else
6665
#defineDEFAULT_CHECKPOINT_FLUSH_AFTER 0
67-
#defineDEFAULT_BACKEND_FLUSH_AFTER 0
6866
#defineDEFAULT_BGWRITER_FLUSH_AFTER 0
6967
#endif/* HAVE_SYNC_FILE_RANGE */
7068

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp