Fwd: Streaming Replication: Checkpoint_segment and wal_keep_segments on standby
Fujii Masao <masao.fujii@gmail.com>
From: Fujii Masao <masao.fujii@gmail.com>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Bruce Momjian <bruce@momjian.us>, Robert Haas <robertmhaas@gmail.com>, "Sander, Ingo (NSN - DE/Munich)" <ingo.sander@nsn.com>, pgsql-hackers@postgresql.org
Date: 2010-07-21T03:25:15Z
Lists: pgsql-hackers
Attachments
- num_of_wal_formula_v1.patch (application/octet-stream) patch v1
- 20100721_num_of_wal_in_pg_xlog.pdf (application/pdf)
On Sat, Jul 17, 2010 at 4:22 AM, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
>> The patch adds the document about the relationship between a restartpoint
>> and checkpoint_segments parameter.
>
> Thanks, committed with minor editorialization
Thanks.
> There will always be at least one WAL segment file, and will normally
> not be more than (2 + <varname>checkpoint_completion_target</varname>) * <varname>checkpoint_segments</varname> + 1
> + or <varname>checkpoint_segments</> + <xref linkend="guc-wal-keep-segments"> + 1
> files. Each segment file is normally 16 MB (though this size can be
> altered when building the server). You can use this to estimate space
> requirements for <acronym>WAL</acronym>.
Sorry, I was wrong here. The correct formula is:
(2 + checkpoint_completion_target) * checkpoint_segments +
wal_keep_segments + 1
The attached patch fixes this fault. And I attached the PDF file which
illustrates the proof of the formula.
Regards,
--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center