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

Commit64da07c

Browse files
committed
Default to log_checkpoints=on, log_autovacuum_min_duration=10m
The idea here is that when a performance problem is known to haveoccurred at a certain point in time, it's a good thing if there issome information available from the logs to help figure out whatmight have happened around that time.This change attracted an above-average amount of dissent, becauseit means that a server with default settings will produce some amountof log output even if nothing has gone wrong. However, by my count,the mailing list discussion had about twice as many people in favorof the change as opposed. The reasons for believing that the extralog output is not an issue in practice are: (1) the rate at whichmessages can be generated by this setting is bounded to one everyfew minutes on a properly-configured system and (2) productionsystems tend to have a lot more junk in the log from that due tofailed connection attempts, ERROR messages generated by applicationactivity, and the like.Bharath Rupireddy, reviewed by Fujii Masao and by me. Many otherpeople commented on the thread, but as far as I can see that wasdiscussion of the merits of the change rather than review of thepatch.Discussion:https://postgr.es/m/CALj2ACX-rW_OeDcp4gqrFUAkf1f50Fnh138dmkd0JkvCNQRKGA@mail.gmail.com
1 parent5cc9c83 commit64da07c

File tree

6 files changed

+16
-17
lines changed

6 files changed

+16
-17
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6764,19 +6764,18 @@ local0.* /var/log/postgresql
67646764
<para>
67656765
Causes each action executed by autovacuum to be logged if it ran for at
67666766
least the specified amount of time. Setting this to zero logs
6767-
all autovacuum actions. <literal>-1</literal> (the default) disables
6768-
logging autovacuum actions.
6769-
If this value is specified without units, it is taken as milliseconds.
6767+
all autovacuum actions. <literal>-1</literal> disables logging autovacuum
6768+
actions. If this value is specified without units, it is taken as milliseconds.
67706769
For example, if you set this to
67716770
<literal>250ms</literal> then all automatic vacuums and analyzes that run
67726771
250ms or longer will be logged. In addition, when this parameter is
67736772
set to any value other than <literal>-1</literal>, a message will be
67746773
logged if an autovacuum action is skipped due to a conflicting lock or a
6775-
concurrently dropped relation. Enabling this parameter can be helpful
6776-
in tracking autovacuum activity. Thisparameter canonlybeset in
6777-
the <filename>postgresql.conf</filename> file or on the server command line;
6778-
but the setting can be overridden for individual tables by
6779-
changing table storage parameters.
6774+
concurrently dropped relation.The default is <literal>10min</literal>.
6775+
Enabling thisparameter can behelpful in tracking autovacuum activity.
6776+
This parameter can only be set inthe <filename>postgresql.conf</filename>
6777+
file or on the server command line;but the setting can be overridden for
6778+
individual tables bychanging table storage parameters.
67806779
</para>
67816780
</listitem>
67826781
</varlistentry>
@@ -6793,7 +6792,7 @@ local0.* /var/log/postgresql
67936792
Some statistics are included in the log messages, including the number
67946793
of buffers written and the time spent writing them.
67956794
This parameter can only be set in the <filename>postgresql.conf</filename>
6796-
file or on the server command line. The default isoff.
6795+
file or on the server command line. The default ison.
67976796
</para>
67986797
</listitem>
67996798
</varlistentry>

‎src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ char *wal_consistency_checking_string = NULL;
107107
bool*wal_consistency_checking=NULL;
108108
boolwal_init_zero= true;
109109
boolwal_recycle= true;
110-
boollog_checkpoints=false;
110+
boollog_checkpoints=true;
111111
intsync_method=DEFAULT_SYNC_METHOD;
112112
intwal_level=WAL_LEVEL_MINIMAL;
113113
intCommitDelay=0;/* precommit delay in microseconds */

‎src/backend/postmaster/autovacuum.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ intautovacuum_multixact_freeze_max_age;
127127
doubleautovacuum_vac_cost_delay;
128128
intautovacuum_vac_cost_limit;
129129

130-
intLog_autovacuum_min_duration=-1;
130+
intLog_autovacuum_min_duration=600000;
131131

132132
/* how long to keep pgstat data in the launcher, in milliseconds */
133133
#defineSTATS_READ_DELAY 1000

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,7 @@ static struct config_bool ConfigureNamesBool[] =
13521352
NULL
13531353
},
13541354
&log_checkpoints,
1355-
false,
1355+
true,
13561356
NULL,NULL,NULL
13571357
},
13581358
{
@@ -3005,7 +3005,7 @@ static struct config_int ConfigureNamesInt[] =
30053005
GUC_UNIT_MS
30063006
},
30073007
&Log_autovacuum_min_duration,
3008-
-1,-1,INT_MAX,
3008+
600000,-1,INT_MAX,
30093009
NULL,NULL,NULL
30103010
},
30113011

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,12 +534,12 @@
534534
#debug_print_rewritten = off
535535
#debug_print_plan = off
536536
#debug_pretty_print = on
537-
#log_autovacuum_min_duration =-1# log autovacuum activity;
537+
#log_autovacuum_min_duration =10min# log autovacuum activity;
538538
# -1 disables, 0 logs all actions and
539539
# their durations, > 0 logs only
540540
# actions running at least this number
541541
# of milliseconds.
542-
#log_checkpoints =off
542+
#log_checkpoints =on
543543
#log_connections = off
544544
#log_disconnections = off
545545
#log_duration = off

‎src/bin/initdb/initdb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ static bool authwarning = false;
200200
* but here it is more convenient to pass it as an environment variable
201201
* (no quoting to worry about).
202202
*/
203-
staticconstchar*boot_options="-F";
204-
staticconstchar*backend_options="--single -F -O -j -c search_path=pg_catalog -c exit_on_error=true";
203+
staticconstchar*boot_options="-F -c log_checkpoints=false";
204+
staticconstchar*backend_options="--single -F -O -j -c search_path=pg_catalog -c exit_on_error=true -c log_checkpoints=false";
205205

206206
/* Additional switches to pass to backend (either boot or standalone) */
207207
staticchar*extra_options="";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp