Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id B8155DFC8F6 for ; Mon, 7 Nov 2011 13:10:24 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 59348-05 for ; Mon, 7 Nov 2011 17:10:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 3AE52DFC8F4 for ; Mon, 7 Nov 2011 13:10:10 -0400 (AST) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Mon, 07 Nov 2011 11:10:09 -0600 Message-Id: <4EB7BC8B0200002500042AFF@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Mon, 07 Nov 2011 11:10:03 -0600 From: "Kevin Grittner" To: "Fujii Masao" ,"Alex Lai" Cc: "Vinay" , "Karuna Karpe" , Subject: Re: streaming replication References: <4EB80391.1020809@sesda2.com> In-Reply-To: <4EB80391.1020809@sesda2.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.381 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-1.201, SARE_SPEC_REPLICA=0.72 X-Spam-Level: X-Archive-Number: 201111/15 X-Sequence-Number: 38609 Alex Lai wrote: > Fujii Masao wrote: >> What about using rsync to take a base backup from new master and >> load it onto old master? rsync can reduce the backup time by >> sending only differences between those two servers. > My postgres instance has two databases. The pg_dump size is about > 30GB size. Rsync the entire $PGDATA take about an hour to a empty > directory. When I rsync the $PGDATA to the existing directory, it > still take 50 minutes. It seems to me that rsync still spend most > of the time checking any changes even with very little changes. > Maybe I miss some option when using rsync can speed up the update. If the bottleneck is the network, be sure that you are using a daemon on the remote side; otherwise you do drag all the data over the wire for any file which doesn't have an identical timestamp and size. An example of how to do that from the rsync man page: rsync -av -e "ssh -l ssh-user" rsync-user@host::module /dest This will try to identify matching portions of files and avoid sending them over the wire. -Kevin