aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2016-06-10 15:31:11 -0700
committerAndres Freund <andres@anarazel.de>2016-06-10 15:31:11 -0700
commit4bc0f165cb4fbd660648c0153485b3d6f55d80ea (patch)
treefde5dfaf4d50a935d67ce57e0eb299601ff104ed /src
parent3303ea1a327b41d3b406d7be7a5ce2901e561066 (diff)
downloadpostgresql-4bc0f165cb4fbd660648c0153485b3d6f55d80ea.tar.gz
postgresql-4bc0f165cb4fbd660648c0153485b3d6f55d80ea.zip
Change default of backend_flush_after GUC to 0 (disabled).
While beneficial, both for throughput and average/worst case latency, in a significant number of workloads, there are other workloads in which backend_flush_after can cause significant performance regressions in comparison to < 9.6 releases. The regression is most likely when the hot data set is bigger than shared buffers, but significantly smaller than the operating system's page cache. I personally think that the benefit of enabling backend flush control is considerably bigger than the potential downsides, but a fair argument can be made that not regressing is more important than improving performance/latency. As the latter is the consensus, change the default to 0. The other settings introduced in 428b1d6b2 do not have the same potential for regressions, so leave them enabled. Benchmarks leading up to changing the default have been performed by Mithun Cy, Ashutosh Sharma and Robert Haas. Discussion: CAD__OuhPmc6XH=wYRm_+Q657yQE88DakN4=Ybh2oveFasHkoeA@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/misc/guc.c3
-rw-r--r--src/backend/utils/misc/postgresql.conf.sample3
-rw-r--r--src/include/storage/bufmgr.h2
3 files changed, 2 insertions, 6 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index cf3eb1a4f14..9b02111a834 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -2457,8 +2457,7 @@ static struct config_int ConfigureNamesInt[] =
GUC_UNIT_BLOCKS
},
&backend_flush_after,
- /* see bufmgr.h: OS dependent default */
- DEFAULT_BACKEND_FLUSH_AFTER, 0, WRITEBACK_MAX_PENDING_FLUSHES,
+ 0, 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 3ef2a9761cc..8260e371bc9 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -170,8 +170,7 @@
#max_parallel_workers_per_gather = 2 # 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 128kb on linux, 0 otherwise
+#backend_flush_after = 0 # 0 disables, default is 0
#------------------------------------------------------------------------------
diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h
index 38b602724e1..3d5dea7efb5 100644
--- a/src/include/storage/bufmgr.h
+++ b/src/include/storage/bufmgr.h
@@ -60,11 +60,9 @@ extern PGDLLIMPORT int NBuffers;
/* FIXME: Also default to on for mmap && msync(MS_ASYNC)? */
#ifdef HAVE_SYNC_FILE_RANGE
#define DEFAULT_CHECKPOINT_FLUSH_AFTER 32
-#define DEFAULT_BACKEND_FLUSH_AFTER 16
#define DEFAULT_BGWRITER_FLUSH_AFTER 64
#else
#define DEFAULT_CHECKPOINT_FLUSH_AFTER 0
-#define DEFAULT_BACKEND_FLUSH_AFTER 0
#define DEFAULT_BGWRITER_FLUSH_AFTER 0
#endif /* HAVE_SYNC_FILE_RANGE */