pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Steele <david@pgmasters.net>
To: Ron <ronljohnsonjr@gmail.com>
To: pgsql-admin@postgresql.org
Cc: Stephen Frost <sfrost@snowman.net>
Subject: Re: pgbackrest periodic WAL backups?
Date: Mon, 10 Dec 2018 08:37:59 -0500
Message-ID: <fb4b6715-42db-958c-b79f-fe507f52b4d7@pgmasters.net> (raw)
In-Reply-To: <859f2c25-3a22-71fa-e1fa-764724183764@gmail.com>
References: <df843a29-494a-7e72-e95a-647941979f1a@gmail.com>
	<20181209191035.GG3415@tamriel.snowman.net>
	<859f2c25-3a22-71fa-e1fa-764724183764@gmail.com>

On 12/9/18 5:24 PM, Ron wrote:
> On 12/09/2018 01:10 PM, Stephen Frost wrote:
>>
>> You can address that risk by enabling archive_timeout, which will make
>> PostgreSQL archive the WAL file even if it isn't full after a certain
>> amount of time, reducing the potential data loss window.
> 
> I thought checkpoint_timeout forced a WAL switch.

Checkpoints do not automatically switch WAL.  archive_timeout is the way
to go.

Postgres >= 9.5 will mostly zero the remainder of the WAL and Postgres
>= 11 will entirely zero it.  Either way, compression works well.

For production systems I generally use archive_timeout=900 so a segment
is archived every 15 minutes when there is not enough activity to force
a switch naturally.  Note that if there is *zero* activity then there in
no need for a WAL switch but some older versions would do so anyway if
wal_level=hot_standby.  We fixed that in Postgres 10.

Regards,
-- 
-David
david@pgmasters.net




view thread (7+ messages)  latest in thread

Message-ID: <fb4b6715-42db-958c-b79f-fe507f52b4d7@pgmasters.net>
Permalink:  ../fb4b6715-42db-958c-b79f-fe507f52b4d7@pgmasters.net/
Also on:    postgresql.org/message-id/fb4b6715-42db-958c-b79f-fe507f52b4d7@pgmasters.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: david@pgmasters.net, ronljohnsonjr@gmail.com, sfrost@snowman.net
  Subject: Re: pgbackrest periodic WAL backups?
  In-Reply-To: <fb4b6715-42db-958c-b79f-fe507f52b4d7@pgmasters.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox