On 03/03/2015 02:12 AM, Fujii Masao wrote:
> On Tue, Mar 3, 2015 at 8:51 AM, Josh Berkus <[email protected]> wrote:
>> On 03/02/2015 03:43 PM, Andres Freund wrote:
>>> Hi,
>>>
>>> On 2015-03-02 15:40:27 -0800, Josh Berkus wrote:
>>>> ! #max_wal_size = 1GB # in logfile segments
>>>
>>> Independent of the rest of the changes, the "in logfile segments" bit
>>> should probably be changed.
>>
>> Point! Although I think it's fair to point out that that wasn't my
>> omission, but Heikki's.
>>
>> Version C, with that correction, attached.
>
> Minor comments:
>
> "The default settings are 5 minutes and 128 MB, respectively." in wal.sgml
> needs to be updated.
>
>
> int max_wal_size = 8; /* 128 MB */
>
> It's better to update the above code in xlog.c. That's not essential, though.
Attached is version D, which incorporates the above two changes, but NOT
a general unit comment cleanup of postgresql.conf, which needs to be an
entirely different patch.
--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
new file mode 100644
index 9261e7f..26214ec
*** a/doc/src/sgml/config.sgml
--- b/doc/src/sgml/config.sgml
*************** include_dir 'conf.d'
*** 2406,2412 ****
checkpoints. This is a soft limit; WAL size can exceed
<varname>max_wal_size</> under special circumstances, like
under heavy load, a failing <varname>archive_command</>, or a high
! <varname>wal_keep_segments</> setting. The default is 128 MB.
Increasing this parameter can increase the amount of time needed for
crash recovery.
This parameter can only be set in the <filename>postgresql.conf</>
--- 2406,2412 ----
checkpoints. This is a soft limit; WAL size can exceed
<varname>max_wal_size</> under special circumstances, like
under heavy load, a failing <varname>archive_command</>, or a high
! <varname>wal_keep_segments</> setting. The default is 1 GB.
Increasing this parameter can increase the amount of time needed for
crash recovery.
This parameter can only be set in the <filename>postgresql.conf</>
diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml
new file mode 100644
index b57749f..f4083c3
*** a/doc/src/sgml/wal.sgml
--- b/doc/src/sgml/wal.sgml
***************
*** 475,481 ****
linkend="guc-checkpoint-timeout"> seconds, or if
<xref linkend="guc-max-wal-size"> is about to be exceeded,
whichever comes first.
! The default settings are 5 minutes and 128 MB, respectively.
If no WAL has been written since the previous checkpoint, new checkpoints
will be skipped even if <varname>checkpoint_timeout</> has passed.
(If WAL archiving is being used and you want to put a lower limit on how
--- 475,481 ----
linkend="guc-checkpoint-timeout"> seconds, or if
<xref linkend="guc-max-wal-size"> is about to be exceeded,
whichever comes first.
! The default settings are 5 minutes and 1 GB, respectively.
If no WAL has been written since the previous checkpoint, new checkpoints
will be skipped even if <varname>checkpoint_timeout</> has passed.
(If WAL archiving is being used and you want to put a lower limit on how
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
new file mode 100644
index a28155f..c3820fa
*** a/src/backend/access/transam/xlog.c
--- b/src/backend/access/transam/xlog.c
*************** extern uint32 bootstrap_data_checksum_ve
*** 79,85 ****
/* User-settable parameters */
! int max_wal_size = 8; /* 128 MB */
int min_wal_size = 5; /* 80 MB */
int wal_keep_segments = 0;
int XLOGbuffers = -1;
--- 79,85 ----
/* User-settable parameters */
! int max_wal_size = 64; /* 1 GB */
int min_wal_size = 5; /* 80 MB */
int wal_keep_segments = 0;
int XLOGbuffers = -1;
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
new file mode 100644
index d84dba7..cc4654a
*** a/src/backend/utils/misc/guc.c
--- b/src/backend/utils/misc/guc.c
*************** static struct config_int ConfigureNamesI
*** 2171,2177 ****
GUC_UNIT_XSEGS
},
&max_wal_size,
! 8, 2, INT_MAX,
NULL, assign_max_wal_size, NULL
},
--- 2171,2177 ----
GUC_UNIT_XSEGS
},
&max_wal_size,
! 64, 2, INT_MAX,
NULL, assign_max_wal_size, NULL
},
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
new file mode 100644
index f8f9ce1..d3ef3e9
*** a/src/backend/utils/misc/postgresql.conf.sample
--- b/src/backend/utils/misc/postgresql.conf.sample
***************
*** 198,204 ****
# - Checkpoints -
#checkpoint_timeout = 5min # range 30s-1h
! #max_wal_size = 128MB # in logfile segments
#min_wal_size = 80MB
#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
#checkpoint_warning = 30s # 0 disables
--- 198,204 ----
# - Checkpoints -
#checkpoint_timeout = 5min # range 30s-1h
! #max_wal_size = 1GB
#min_wal_size = 80MB
#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
#checkpoint_warning = 30s # 0 disables
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers