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

Commit 4b113d9

Browse files
committed
Document that archive_timeout will force new WAL files even if a single
checkpoint has happened, and recommend adjusting checkpoint_timeout to reduce the impact of this.
1 parent ef51fa5 commit 4b113d9

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

doc/src/sgml/config.sgml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.249 2010/02/03 17:25:05 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.250 2010/02/05 23:37:43 momjian Exp $ -->
22

33
<chapter Id="runtime-config">
44
<title>Server Configuration</title>
@@ -1739,7 +1739,11 @@ archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"' # Windows
17391739
server to switch to a new WAL segment file periodically. When this
17401740
parameter is greater than zero, the server will switch to a new
17411741
segment file whenever this many seconds have elapsed since the last
1742-
segment file switch. Note that archived files that are closed early
1742+
segment file switch, and there has been any database activity,
1743+
including a single checkpoint. (Increasing
1744+
<varname>checkpoint_timeout</> will reduce unnecessary
1745+
checkpoints on an idle system.)
1746+
Note that archived files that are closed early
17431747
due to a forced switch are still the same length as completely full
17441748
files. Therefore, it is unwise to use a very short
17451749
<varname>archive_timeout</> &mdash; it will bloat your archive

src/backend/postmaster/bgwriter.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*
3939
*
4040
* IDENTIFICATION
41-
* $PostgreSQL: pgsql/src/backend/postmaster/bgwriter.c,v 1.66 2010/01/15 09:19:02 heikki Exp $
41+
* $PostgreSQL: pgsql/src/backend/postmaster/bgwriter.c,v 1.67 2010/02/05 23:37:43 momjian Exp $
4242
*
4343
*-------------------------------------------------------------------------
4444
*/
@@ -543,7 +543,10 @@ BackgroundWriterMain(void)
543543

544544
/*
545545
* CheckArchiveTimeout -- check for archive_timeout and switch xlog files
546-
* if needed
546+
*
547+
* This will switch to a new WAL file and force an archive file write
548+
* if any activity is recorded in the current WAL file, including just
549+
* a single checkpoint record.
547550
*/
548551
static void
549552
CheckArchiveTimeout(void)

0 commit comments

Comments
 (0)