aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Frost <sfrost@snowman.net>2021-03-24 13:07:51 -0400
committerStephen Frost <sfrost@snowman.net>2021-03-24 13:07:51 -0400
commitbbcc4eb2e08fb6e4535c7f84b2c00f3ad508bb9b (patch)
tree64b67f0b4ba21b9ac6496b6f3f21c1e456a77920 /src
parente5595de03ec6ce60afde980ae05e9353a1501fdf (diff)
downloadpostgresql-bbcc4eb2e08fb6e4535c7f84b2c00f3ad508bb9b.tar.gz
postgresql-bbcc4eb2e08fb6e4535c7f84b2c00f3ad508bb9b.zip
Change checkpoint_completion_target default to 0.9
Common recommendations are that the checkpoint should be spread out as much as possible, provided we avoid having it take too long. This change updates the default to 0.9 (from 0.5) to match that recommendation. There was some debate about possibly removing the option entirely but it seems there may be some corner-cases where having it set much lower to try to force the checkpoint to be as fast as possible could result in fewer periods of time of reduced performance due to kernel flushing. General agreement is that the "spread more" is the preferred approach though and those who need to tune away from that value are much less common. Reviewed-By: Michael Paquier, Peter Eisentraut, Tom Lane, David Steele, Nathan Bossart Discussion: https://postgr.es/m/20201207175329.GM16415%40tamriel.snowman.net
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/checkpointer.c2
-rw-r--r--src/backend/utils/misc/guc.c2
-rw-r--r--src/backend/utils/misc/postgresql.conf.sample2
-rw-r--r--src/test/recovery/t/015_promotion_pages.pl1
4 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c
index 5907a7befc5..e7e6a2a4594 100644
--- a/src/backend/postmaster/checkpointer.c
+++ b/src/backend/postmaster/checkpointer.c
@@ -145,7 +145,7 @@ static CheckpointerShmemStruct *CheckpointerShmem;
*/
int CheckPointTimeout = 300;
int CheckPointWarning = 30;
-double CheckPointCompletionTarget = 0.5;
+double CheckPointCompletionTarget = 0.9;
/*
* Private state
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index cc0b9f6ad62..0c5dc4d3e84 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -3725,7 +3725,7 @@ static struct config_real ConfigureNamesReal[] =
NULL
},
&CheckPointCompletionTarget,
- 0.5, 0.0, 1.0,
+ 0.9, 0.0, 1.0,
NULL, NULL, NULL
},
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index 74b416b74a8..b234a6bfe64 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -231,7 +231,7 @@
#checkpoint_timeout = 5min # range 30s-1d
#max_wal_size = 1GB
#min_wal_size = 80MB
-#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
+#checkpoint_completion_target = 0.9 # checkpoint target duration, 0.0 - 1.0
#checkpoint_flush_after = 0 # measured in pages, 0 disables
#checkpoint_warning = 30s # 0 disables
diff --git a/src/test/recovery/t/015_promotion_pages.pl b/src/test/recovery/t/015_promotion_pages.pl
index 6fb70b5001b..25a9e4764a2 100644
--- a/src/test/recovery/t/015_promotion_pages.pl
+++ b/src/test/recovery/t/015_promotion_pages.pl
@@ -26,7 +26,6 @@ my $bravo = get_new_node('bravo');
$bravo->init_from_backup($alpha, 'bkp', has_streaming => 1);
$bravo->append_conf('postgresql.conf', <<EOF);
checkpoint_timeout=1h
-checkpoint_completion_target=0.9
EOF
$bravo->start;