pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Scalia <jayknowsunix@gmail.com>
To: Matheus de Oliveira <matioli.matheus@gmail.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Hourly backup using pg_basebackup
Date: Fri, 06 Feb 2015 14:50:32 -0500
Message-ID: <54D51B08.5050901@gmail.com> (raw)
In-Reply-To: <CAJghg4+JXVs1_k12M=Ozu_pzma0eBPQO++hA5b7C2vhXAh2-tg@mail.gmail.com>
References: <54D50D9B.1090905@gmail.com>
	<CAJghg4+JXVs1_k12M=Ozu_pzma0eBPQO++hA5b7C2vhXAh2-tg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>


On 2/6/2015 2:25 PM, Matheus de Oliveira wrote:
>
> On Fri, Feb 6, 2015 at 4:53 PM, John Scalia <jayknowsunix@gmail.com <mailto:jayknowsunix@gmail.com>> wrote:
>
>     We have a python script called by cron on an hourly basis to back up our production database. Currently, the script invokes pg_dump and takes more than hour to complete.
>     Hence the script looks to see if it's already running and exits if so. I want to change the script so it uses pg_basebackup instead since that's so much faster.
>
>
> Have you considered using incremental backup (continuous archiving) instead of a such small backup window?
>
> See [1]
>
>     My problem is, however, that while I'd like to just have it build a tarball, maybe compressed,  I can't use a "-X s" option for the wal segments. I think I understand why I
>     can't use the streaming option with a "-Ft" specified. I'm just concerned about the docs saying that the backup may have problems with fetch as a wal segment may have
>     expired. Manually testing is showing that the Db needs about 11 minutes to backup with pg_basebackup, and our wal_keep_segments setting is 6.  This said, an hour's worth of
>     wal segments should be available, but the six that were there at the beginning of the backup are not the same six there at the end. I don't think this is really a problem,
>     but I'd like to get it confirmed. Wouldn't the backup actually have to take more than hour for this to be an issue?
>
>
> If you use archiving [1], you don't need to worry about saving the segments withing the backup, just let it be done through archive_command. Isn't that an option for you? If 
> don't, why?
>
Oh, yes, I did fail to mention that the system where I'm trying this is the primary in a streaming replication cluster with (2) hot standby servers. I've mentioned without much 
traction, that we don't really even need a backup with 3 servers ready to do the work without delays. Like I said in the last post, it's all political.
>
> [1] http://www.postgresql.org/docs/current/static/continuous-archiving.html
>
> Best regards,
> -- 
> Matheus de Oliveira
> Analista de Banco de Dados
> Dextra Sistemas - MPS.Br nĂ­vel F!
> www.dextra.com.br/postgres <http://www.dextra.com.br/postgres/;
>

view thread (6+ messages)  latest in thread

Message-ID: <54D51B08.5050901@gmail.com>
Permalink:  ../54D51B08.5050901@gmail.com/
Also on:    postgresql.org/message-id/54D51B08.5050901@gmail.com

 · 

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: jayknowsunix@gmail.com, matioli.matheus@gmail.com
  Subject: Re: Hourly backup using pg_basebackup
  In-Reply-To: <54D51B08.5050901@gmail.com>

* 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