Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXZ3g-0005u8-7h for pgsql-bugs@arkaria.postgresql.org; Tue, 08 Apr 2014 16:39:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WXZ3f-0006kX-KT for pgsql-bugs@arkaria.postgresql.org; Tue, 08 Apr 2014 16:39:35 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXZ3e-0006kQ-GR for pgsql-bugs@postgresql.org; Tue, 08 Apr 2014 16:39:34 +0000 Received: from smtp74.ord1c.emailsrvr.com ([108.166.43.74]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXZ3b-0000BE-Lt for pgsql-bugs@postgresql.org; Tue, 08 Apr 2014 16:39:33 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 9E6AB1E96D5; Tue, 8 Apr 2014 12:39:30 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp2.relay.ord1c.emailsrvr.com (Authenticated sender: jeff.frost-AT-pgexperts.com) with ESMTPSA id 042561E96BF; Tue, 8 Apr 2014 12:39:29 -0400 (EDT) Content-Type: multipart/signed; boundary="Apple-Mail=_7E004161-B5EF-49D0-9820-35261B75C70F"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: Configuring Standby Server in PostgreSQL 9.3.3 From: Jeff Frost In-Reply-To: <5343CC85.6050105@vmware.com> Date: Tue, 8 Apr 2014 09:39:28 -0700 Cc: fburgess@radiantblue.com, Michele , pgsql-bugs@postgresql.org Message-Id: <11DA2B95-F76C-4DC9-A770-5D205C034141@pgexperts.com> References: <20140407152514.5a830134ae84016b0174832fdc1a3173.38bd7c0e22.wbe@email11.secureserver.net> <5343CC85.6050105@vmware.com> To: Heikki Linnakangas X-Mailer: Apple Mail (2.1874) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --Apple-Mail=_7E004161-B5EF-49D0-9820-35261B75C70F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Apr 8, 2014, at 3:16 AM, Heikki Linnakangas = 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. >>=20 >> 1.) Running from the slave. 1.2.3.4 is the ip of master database. >>=20 >> basebackup -D /u01/fiber/postgreSQL_data -F p -x stream -c fast -P -v = -h 1.2.3.4 >> -p 5432 -U replication >>=20 >> 2.) compared to ... >>=20 >> psql -c "select pg_start_backup('initial_backup');" >> rsync -cva --inplace --exclude=3D*pg_xlog* = /u01/fiber/postgreSQL_data/ >> postgres@1.2.3.4:/u01/fiber/postgreSQL_data/ >> psql -c " select pg_stop_backup () ;" >>=20 >> 3.) or this ... >>=20 >> psql =96c =93select pg_start_backup(=91hot backup=92)=94 >> cp =96pr /u01/fiber/postgreSQL_data = 1.2.3.4:/u01/fiber/postgreSQL_data >> psql =96c =93select pg_stop_backup(=91hot backup=92)=94 >=20 > 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-benchma= rk.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. --Apple-Mail=_7E004161-B5EF-49D0-9820-35261B75C70F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://www.gpgtools.org/ iEYEARECAAYFAlNEJkAACgkQbElkk0i3T39vSACcCy0mgh312HQzDNOnYNkWOBqK utcAnikcD2Qq41JSTht2KsV9f9unMlwU =4UDJ -----END PGP SIGNATURE----- --Apple-Mail=_7E004161-B5EF-49D0-9820-35261B75C70F--