Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E4BB39F9CED for ; Fri, 28 Sep 2007 10:18:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 37754-10 for ; Fri, 28 Sep 2007 10:17:54 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by postgresql.org (Postfix) with ESMTP id DA68D9F9B11 for ; Fri, 28 Sep 2007 10:17:53 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id f5so2035468nfh for ; Fri, 28 Sep 2007 06:17:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=SRWvuXKMziakNjW72aBDaYWq7sKdxni/M/IwtUuZsQY=; b=d5ahamwEn55d5qmlcl3tWFtO4MV24sV2r2clLMNWQp8H3gxiNJwPnnh0OMfQuVpy5c0GN8d1X4oT/bHCxp9paAouU9Wjb+2Vx4UAP3Rl0iUyTrq6lgg3L3OOFGz6wDqCaRYVizX2vlRWm2mAmjo5vCnFEN6aLpzRfgjDDCP0G7I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Hj0US/u/QtWcg3Ni8D5vy0H4GfnsD+8YZR1xy653gdBxKmp2oAtb31oLYBFVfg8fWeav0N0irCQneal3WwbLA2pJG55sJy/E9BFTAiX6B5BfyGapZAm5TW1kAeYbmLArP1xF5+pVSYyx2BV4zopRJBdR5TZRlGTSAzMERy0N2vg= Received: by 10.78.159.7 with SMTP id h7mr3091349hue.1190985471451; Fri, 28 Sep 2007 06:17:51 -0700 (PDT) Received: by 10.78.33.6 with HTTP; Fri, 28 Sep 2007 06:17:51 -0700 (PDT) Message-ID: Date: Fri, 28 Sep 2007 09:17:51 -0400 From: "Merlin Moncure" To: "Kevin Kempter" Subject: Re: Tuning for warm standby Cc: "postgres performance list" In-Reply-To: <200709271142.07130.kevin@kevinkempterllc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200709271142.07130.kevin@kevinkempterllc.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/465 X-Sequence-Number: 27010 On 9/27/07, Kevin Kempter wrote: > Hi All; > > I'm preparing to fire up WAL archiving on 8 production servers We will follow > up with implementing a warm standby scenariio. > > Does anyone have any thoughts per how to maximize performance, yet minimize > the potential for data loss assuming we were not able to retrieve the final > un-archived WAL segment from the original pg_xlog dir in the case of a crash? the standby mechanism is actually very simple and there is very little to do for efficient operation. all the hard work is done inside the wal algorithms and from the outside it works like a fancy rsync. some performance tips: * don't use encrypted channel (scp) to transfer wal segments from primary to secondary. * make sure the link between servers is gigabit at least. bonded ethernet couldn't hurt if you can easily fit it in your topology * do not directly write wal segments (nfs, cifs) to the remote folder. whatever you use, make sure it puts files into the remote folder atomically unless it is specifically designed to handle wal segments. * there's not much to do on the standby side. I've set up a few warm standby systems with pg_standby...it works great. I find it works best using link mode (-l) and at lest 256 wal file before it prunes. 'archive_timeout' is a way to guarantee your last transferred file is no older than 'x' seconds. I am not a big fan of setting this...most of the servers I work with are fairly busy and I'd prefer to let the server decide when to flip files. I would only consider setting this in a server that had very little writing going on but what did get written was important. There is a new player in warm standby systems (developed by skype!): http://pgfoundry.org/projects/skytools/ I haven't looked at it yet, but supposedly it can stream WAL files over real time. definately worth looking in to. This would moot some of the other advice I've given here. merlin