Number of WAL segment

Started by tdev457over 12 years ago5 messagesgeneral
Jump to latest
#1tdev457
idzob23@gmail.com

Hi,
I am using PostgreSQL 8.3.8!!!
How can I increase number of WAL segments in pg_xlog???
Current settings are:
checkpoint_segments=10
checkpoint_completion_target=0.5

WAL segments are generated every 10 min and I want to keep WAL segments in
pg_xlog for at least 3h.

Thanks...

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Number-of-WAL-segment-tp5771221.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Hironobu SUZUKI
hironobu@interdb.jp
In reply to: tdev457 (#1)
Re: Number of WAL segment

Hi,

(13/09/17 21:46), tdev457 wrote:

Hi,
I am using PostgreSQL 8.3.8!!!
How can I increase number of WAL segments in pg_xlog???
Current settings are:
checkpoint_segments=10
checkpoint_completion_target=0.5

WAL segments are generated every 10 min and I want to keep WAL segments in
pg_xlog for at least 3h.

In 8.3, the number of wal segments can not be controlled explicitly.
# If you can use version 9.0 or higher, please see here:
#
http://www.postgresql.org/docs/9.3/static/runtime-config-replication.html#GUC-WAL-KEEP-SEGMENTS

In any case, It is not possible to control the retention period.
I recommend WAL Archiving, if you want to save 3 hour's wal segments
with certainty.

Regards,

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3tdev457
idzob23@gmail.com
In reply to: Hironobu SUZUKI (#2)
Re: Number of WAL segment

Thanks,
I am confused now.When checkpoint_segment is set to 3 there are 7 WAL
segments in pg_xlog.When I set checkpoint_segments to 10 there are 11 WAL
segments.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Number-of-WAL-segment-tp5771221p5771321.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Michael Paquier
michael@paquier.xyz
In reply to: tdev457 (#3)
Re: Number of WAL segment

On Tue, Sep 17, 2013 at 2:35 PM, tdev457 <idzob23@gmail.com> wrote:

Thanks,
I am confused now.When checkpoint_segment is set to 3 there are 7 WAL
segments in pg_xlog.When I set checkpoint_segments to 10 there are 11 WAL
segments.

The maximum number of WAL files is defined by this formula:
(2 + checkpoint_completion_target) * checkpoint_segments + 1
http://www.postgresql.org/docs/8.3/static/wal-configuration.html
Note that this is a soft limit, there could be more than 3 *
checkpoint_segments + 1 for a short period.
--
Michael

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Michael Paquier
michael@paquier.xyz
In reply to: tdev457 (#1)
Re: Number of WAL segment

On Tue, Sep 17, 2013 at 9:46 PM, tdev457 <idzob23@gmail.com> wrote:

Hi,
I am using PostgreSQL 8.3.8!!!
How can I increase number of WAL segments in pg_xlog???
Current settings are:
checkpoint_segments=10
checkpoint_completion_target=0.5

WAL segments are generated every 10 min and I want to keep WAL segments in
pg_xlog for at least 3h.

It is not possible to keep WAL files in pg_xlog in 8.3 for such a
duration as checkpoint_timeout would kick a checkpoint at least every
hour even if you'd set it to its maximum value which is 1 hour. So the
solution to keep 3 hours of WAL files in this case is simply to use an
archive, and to delete periodically old files no longer needed based
on your needs.

Note that you could use wal_keep_segments with a server >= 9.1 to do that.
--
Michael

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general