Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 53d2951

Browse files
committed
Set a default autovacuum vacuum_cost_delay value of 20ms, to avoid excessive
I/O utilization, per discussion. While at it, lower the autovacuum vacuum and analyze threshold values to 50 tuples. It is a bit higher (i.e. more conservative) than what I originally proposed but much better than the old values for small tables.
1 parent ab7d2b6 commit 53d2951

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

doc/src/sgml/config.sgml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.131 2007/07/18 12:00:47 mha Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.132 2007/07/24 01:53:55 alvherre Exp $ -->
22

33
<chapter Id="runtime-config">
44
<title>Server Configuration</title>
@@ -3247,7 +3247,7 @@ SELECT * FROM parent WHERE key = 2400;
32473247
<para>
32483248
Specifies the minimum number of updated or deleted tuples needed
32493249
to trigger a <command>VACUUM</> in any one table.
3250-
The default is 500 tuples.
3250+
The default is 50 tuples.
32513251
This parameter can only be set in the <filename>postgresql.conf</>
32523252
file or on the server command line.
32533253
This setting can be overridden for individual tables by entries in
@@ -3265,7 +3265,7 @@ SELECT * FROM parent WHERE key = 2400;
32653265
<para>
32663266
Specifies the minimum number of inserted, updated or deleted tuples
32673267
needed to trigger an <command>ANALYZE</> in any one table.
3268-
The default is 250 tuples.
3268+
The default is 50 tuples.
32693269
This parameter can only be set in the <filename>postgresql.conf</>
32703270
file or on the server command line.
32713271
This setting can be overridden for individual tables by entries in
@@ -3343,8 +3343,9 @@ SELECT * FROM parent WHERE key = 2400;
33433343
<para>
33443344
Specifies the cost delay value that will be used in automatic
33453345
<command>VACUUM</> operations. If <literal>-1</> is
3346-
specified (which is the default), the regular
3346+
specified, the regular
33473347
<xref linkend="guc-vacuum-cost-delay"> value will be used.
3348+
The default value is 20 milliseconds.
33483349
This parameter can only be set in the <filename>postgresql.conf</>
33493350
file or on the server command line.
33503351
This setting can be overridden for individual tables by entries in

src/backend/utils/misc/guc.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.405 2007/07/10 13:14:21 mha Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.406 2007/07/24 01:53:56 alvherre Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -1348,7 +1348,7 @@ static struct config_int ConfigureNamesInt[] =
13481348
GUC_UNIT_MS
13491349
},
13501350
&autovacuum_vac_cost_delay,
1351-
-1, -1, 1000, NULL, NULL
1351+
20, -1, 1000, NULL, NULL
13521352
},
13531353

13541354
{
@@ -1656,15 +1656,15 @@ static struct config_int ConfigureNamesInt[] =
16561656
NULL
16571657
},
16581658
&autovacuum_vac_thresh,
1659-
500, 0, INT_MAX, NULL, NULL
1659+
50, 0, INT_MAX, NULL, NULL
16601660
},
16611661
{
16621662
{"autovacuum_analyze_threshold", PGC_SIGHUP, AUTOVACUUM,
16631663
gettext_noop("Minimum number of tuple inserts, updates or deletes prior to analyze."),
16641664
NULL
16651665
},
16661666
&autovacuum_anl_thresh,
1667-
250, 0, INT_MAX, NULL, NULL
1667+
50, 0, INT_MAX, NULL, NULL
16681668
},
16691669
{
16701670
/* see varsup.c for why this is PGC_POSTMASTER not PGC_SIGHUP */

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -381,17 +381,17 @@
381381
#log_autovacuum = -1 # -1 is disabled, 0 logs all actions
382382
# and their durations, > 0 logs only
383383
# actions running at least N msec.
384-
#autovacuum_vacuum_threshold = 500 # min # of tuple updates before
384+
#autovacuum_vacuum_threshold = 50 # min # of tuple updates before
385385
# vacuum
386-
#autovacuum_analyze_threshold = 250 # min # of tuple updates before
386+
#autovacuum_analyze_threshold = 50 # min # of tuple updates before
387387
# analyze
388388
#autovacuum_vacuum_scale_factor = 0.2 # fraction of rel size before
389389
# vacuum
390390
#autovacuum_analyze_scale_factor = 0.1 # fraction of rel size before
391391
# analyze
392392
#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
393393
# (change requires restart)
394-
#autovacuum_vacuum_cost_delay = -1 # default vacuum cost delay for
394+
#autovacuum_vacuum_cost_delay = 20 # default vacuum cost delay for
395395
# autovacuum, -1 means use
396396
# vacuum_cost_delay
397397
#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for

0 commit comments

Comments
 (0)