diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-11-25 18:36:10 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-11-25 18:36:10 -0500 |
commit | 255bcd27f635a1b9682e7e0dfd348b0f8b268df1 (patch) | |
tree | 4d8d27e4c2335db4ecb07cbf903719d18c2e274e /src/backend/utils | |
parent | 474de765a8003bc58f5736f626bf533147cc1e68 (diff) | |
download | postgresql-255bcd27f635a1b9682e7e0dfd348b0f8b268df1.tar.gz postgresql-255bcd27f635a1b9682e7e0dfd348b0f8b268df1.zip |
Bring some clarity to the defaults for the xxx_flush_after parameters.
Instead of confusingly stating platform-dependent defaults for these
parameters in the comments in postgresql.conf.sample (with the main
entry being a lie on Linux), teach initdb to install the correct
platform-dependent value in postgresql.conf, similarly to the way
we handle other platform-dependent defaults. This won't do anything
for existing 9.6 installations, but since it's effectively only a
documentation improvement, that seems OK.
Since this requires initdb to have access to the default values,
move the #define's for those to pg_config_manual.h; the original
placement in bufmgr.h is unworkable because that file can't be
included by frontend programs.
Adjust the default value for wal_writer_flush_after so that it is 1MB
regardless of XLOG_BLCKSZ, conforming to what is stated in both the
SGML docs and postgresql.conf. (We could alternatively make it scale
with XLOG_BLCKSZ, but I'm not sure I see the point.)
Copy-edit related SGML documentation.
Fabien Coelho and Tom Lane, per a gripe from Tomas Vondra.
Discussion: <30ebc6e3-8358-09cf-44a8-578252938424@2ndquadrant.com>
Diffstat (limited to 'src/backend/utils')
-rw-r--r-- | src/backend/utils/misc/guc.c | 8 | ||||
-rw-r--r-- | src/backend/utils/misc/postgresql.conf.sample | 12 |
2 files changed, 8 insertions, 12 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 75755fa191d..4f1891f8440 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -2275,7 +2275,6 @@ static struct config_int ConfigureNamesInt[] = GUC_UNIT_BLOCKS }, &checkpoint_flush_after, - /* see bufmgr.h: OS dependent default */ DEFAULT_CHECKPOINT_FLUSH_AFTER, 0, WRITEBACK_MAX_PENDING_FLUSHES, NULL, NULL, NULL }, @@ -2304,12 +2303,12 @@ static struct config_int ConfigureNamesInt[] = { {"wal_writer_flush_after", PGC_SIGHUP, WAL_SETTINGS, - gettext_noop("Amount of WAL written out by WAL writer triggering a flush."), + gettext_noop("Amount of WAL written out by WAL writer that triggers a flush."), NULL, GUC_UNIT_XBLOCKS }, &WalWriterFlushAfter, - 128, 0, INT_MAX, + (1024*1024) / XLOG_BLCKSZ, 0, INT_MAX, NULL, NULL, NULL }, @@ -2433,7 +2432,6 @@ static struct config_int ConfigureNamesInt[] = GUC_UNIT_BLOCKS }, &bgwriter_flush_after, - /* see bufmgr.h: OS dependent default */ DEFAULT_BGWRITER_FLUSH_AFTER, 0, WRITEBACK_MAX_PENDING_FLUSHES, NULL, NULL, NULL }, @@ -2461,7 +2459,7 @@ static struct config_int ConfigureNamesInt[] = GUC_UNIT_BLOCKS }, &backend_flush_after, - 0, 0, WRITEBACK_MAX_PENDING_FLUSHES, + DEFAULT_BACKEND_FLUSH_AFTER, 0, WRITEBACK_MAX_PENDING_FLUSHES, NULL, NULL, NULL }, diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index ed81e64c0b4..fa6c0eaa801 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -156,8 +156,7 @@ #bgwriter_delay = 200ms # 10-10000ms between rounds #bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round #bgwriter_lru_multiplier = 2.0 # 0-10.0 multiplier on buffers scanned/round -#bgwriter_flush_after = 0 # 0 disables, - # default is 512kB on linux, 0 otherwise +#bgwriter_flush_after = 0 # measured in pages, 0 disables # - Asynchronous Behavior - @@ -165,8 +164,8 @@ #max_worker_processes = 8 # (change requires restart) #max_parallel_workers_per_gather = 0 # taken from max_worker_processes #old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate - # (change requires restart) -#backend_flush_after = 0 # 0 disables, default is 0 + # (change requires restart) +#backend_flush_after = 0 # measured in pages, 0 disables #------------------------------------------------------------------------------ @@ -196,7 +195,7 @@ #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers # (change requires restart) #wal_writer_delay = 200ms # 1-10000 milliseconds -#wal_writer_flush_after = 1MB # 0 disables +#wal_writer_flush_after = 1MB # measured in pages, 0 disables #commit_delay = 0 # range 0-100000, in microseconds #commit_siblings = 5 # range 1-1000 @@ -207,8 +206,7 @@ #max_wal_size = 1GB #min_wal_size = 80MB #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 -#checkpoint_flush_after = 0 # 0 disables, - # default is 256kB on linux, 0 otherwise +#checkpoint_flush_after = 0 # measured in pages, 0 disables #checkpoint_warning = 30s # 0 disables # - Archiving - |