pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedodd pg_start_backup() issue
2+ messages / 2 participants
[nested] [flat]
* odd pg_start_backup() issue
@ 2014-01-31 17:55 CS DBA <cs_dba@consistentstate.com>
0 siblings, 1 reply; 2+ messages in thread
From: CS DBA @ 2014-01-31 17:55 UTC (permalink / raw)
To: pgsql-admin; +Cc: cs_dba@consistentstate.com
Hi All;
I'm setting up PITR based backups on a production db server.
When the script runs the pg_start_backup it takes forever, like 30minutes+
I can run a checkpoint while waiting for it to complete and it finishes
almost immediately
For now we're executing the start backup like this (in the automated
base backup script:
echo "checkpoint; select pg_start_backup('$tag'); checkpoint;" | psql
we tried it like this and id did not help:
echo "checkpoint; select pg_start_backup('$tag');" | psql
so we added the checkpoint after the pg_start_backup command
Next I'll try this (I assume the first checkpoint is simply un-needed):
echo "select pg_start_backup('$tag'); checkpoint;" | psql
However, this works well and the pg_start_backup finishes in less than
1minute,
but if I leave the checkpoint command(s) out then we're back to
30minutes or more for the pg_start_backup...
We're running version 9.2.4 on a Centos 6 server
Thoughts?
Thanks in advance
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: odd pg_start_backup() issue
@ 2014-02-01 00:43 Sergey Konoplev <gray.ru@gmail.com>
parent: CS DBA <cs_dba@consistentstate.com>
0 siblings, 0 replies; 2+ messages in thread
From: Sergey Konoplev @ 2014-02-01 00:43 UTC (permalink / raw)
To: CS DBA <cs_dba@consistentstate.com>; +Cc: pgsql-admin
On Fri, Jan 31, 2014 at 9:55 AM, CS DBA <cs_dba@consistentstate.com> wrote:
[...]
> Next I'll try this (I assume the first checkpoint is simply un-needed):
> echo "select pg_start_backup('$tag'); checkpoint;" | psql
> However, this works well and the pg_start_backup finishes in less than
> 1minute,
I wonder how it helped at all, because it should not. Probably it was
some kind of a coincidence.
[...]
> Thoughts?
The note below is from the docs for pg_start_backup().
"pg_start_backup(label text [, fast boolean ])
...
There is an optional second parameter of type boolean. If true, it
specifies executing pg_start_backup as quickly as possible. This
forces an immediate checkpoint which will cause a spike in I/O
operations, slowing any concurrently executing queries."
So all you need is to specify 'true' as a second parameter.
select pg_start_backup('$tag', true)
--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA
http://www.linkedin.com/in/grayhemp
+1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
gray.ru@gmail.com
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2014-02-01 00:43 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-01-31 17:55 odd pg_start_backup() issue CS DBA <cs_dba@consistentstate.com>
2014-02-01 00:43 ` Sergey Konoplev <gray.ru@gmail.com>
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