Re: PostgreSQL Dump rate is too slow

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Robert Burgholzer <rburghol(at)vt(dot)edu>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: PostgreSQL Dump rate is too slow
Date: 2015-01-08 13:58:11
Message-ID: 844546511.3807408.1420725491363.JavaMail.yahoo@jws10097.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Robert Burgholzer <rburghol(at)vt(dot)edu> wrote:

> To elaborate, I have found the rsync used in my (most?) streaming
> replication setups is 10x or more faster than pg_dump. If your
> job specs required a pg_dump output file it would be fairly simple
> to do the following (moree or less):
> 1. setup a replicant (even on the same machine but different
> drive if you wanted)
> 2. make sure the replicant is off
> 3. rsync the data dir to the replicant
> 4. turn on the replicant
> 5. execute pg_dump on the replicant

If the original cluster is running, unless the steps for a PITR
backup are followed, that rsync could generated a corrupted
database. The corruption may not be immediately apparent, and
might not happen every time, but the above is not safe without a
few more steps.

http://www.postgresql.org/docs/9.2/interactive/continuous-archiving.html

This is not intended as a complete list, but among other things
archiving should be working first, the rsync should exclude the
postmaster.pid file and the files under the pg_xlog directory,
rsync should be preceded by pg_start_backup() and followed by
pg_stop_backup(), and a recovery.conf file is needed.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message David G Johnston 2015-01-08 15:38:37 Re: PostgreSQL Dump rate is too slow
Previous Message Scott Ribe 2015-01-08 13:45:45 Re: PostgreSQL Dump rate is too slow