pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Frost <jeff@pgexperts.com>
To: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: fburgess@radiantblue.com
Cc: Michele <michele.mariani@databtech.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Configuring Standby Server in PostgreSQL 9.3.3
Date: Tue, 8 Apr 2014 09:39:28 -0700
Message-ID: <11DA2B95-F76C-4DC9-A770-5D205C034141@pgexperts.com> (raw)
In-Reply-To: <5343CC85.6050105@vmware.com>
References: <20140407152514.5a830134ae84016b0174832fdc1a3173.38bd7c0e22.wbe@email11.secureserver.net>
	<5343CC85.6050105@vmware.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>


On Apr 8, 2014, at 3:16 AM, Heikki Linnakangas <hlinnakangas@vmware.com> wrote:

> On 04/08/2014 01:25 AM, fburgess@radiantblue.com wrote:
>> Did you guys benchmark the basebackup utility? The master database will have to
>> remain online during this backup/restore process, since it is receiving real
>> time data feeds. Not sure which technique is better for our 7TB db.
>> 
>> 1.) Running from the slave.  1.2.3.4 is the ip of master database.
>> 
>> basebackup -D /u01/fiber/postgreSQL_data -F p -x stream -c fast -P -v -h 1.2.3.4
>> -p 5432 -U replication
>> 
>> 2.) compared to ...
>> 
>> psql -c "select pg_start_backup('initial_backup');"
>> rsync -cva --inplace --exclude=*pg_xlog* /u01/fiber/postgreSQL_data/
>> postgres@1.2.3.4:/u01/fiber/postgreSQL_data/
>> psql -c " select pg_stop_backup () ;"
>> 
>> 3.) or this ...
>> 
>> psql –c “select pg_start_backup(‘hot backup’)”
>> cp –pr /u01/fiber/postgreSQL_data 1.2.3.4:/u01/fiber/postgreSQL_data
>> psql –c “select pg_stop_backup(‘hot backup’)”
> 
> I bet the rsync or cp method is faster. Dunno how much, though, that depends on what the bottleneck is; the network, or the disk, or something else. You'll have to measure it yourself, to know how it is in your environment.
> - Heikki

FWIW, I benchmarked a few methods here:

http://frosty-postgres.blogspot.com/2011/12/postgresql-base-backup-benchmark.html

admittedly, the base backup was much smaller, but I suspect you would see similar performance with a larger base backup.

You might also try running the rsync once, before issuing pg_start_backup() and then doing a normal base backup so that rsync can take advantage of partial file copy.

If you use rsync over ssh, make sure to use the arcfour cipher for best performance.

Attachments:

  signature.asc (application/pgp-signature, 207B) download

view thread (12+ messages)  latest in thread

Message-ID: <11DA2B95-F76C-4DC9-A770-5D205C034141@pgexperts.com>
Permalink:  ../11DA2B95-F76C-4DC9-A770-5D205C034141@pgexperts.com/
Also on:    postgresql.org/message-id/11DA2B95-F76C-4DC9-A770-5D205C034141@pgexperts.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: jeff@pgexperts.com, hlinnakangas@vmware.com, fburgess@radiantblue.com, michele.mariani@databtech.com
  Subject: Re: Configuring Standby Server in PostgreSQL 9.3.3
  In-Reply-To: <11DA2B95-F76C-4DC9-A770-5D205C034141@pgexperts.com>
  References: <20140407152514.5a830134ae84016b0174832fdc1a3173.38bd7c0e22.wbe@email11.secureserver.net> <5343CC85.6050105@vmware.com> <11DA2B95-F76C-4DC9-A770-5D205C034141@pgexperts.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