Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 244021337990 for ; Mon, 11 Apr 2011 18:46:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 13281-08 for ; Mon, 11 Apr 2011 21:46:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id B8037133740B for ; Mon, 11 Apr 2011 18:46:26 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Mon, 11 Apr 2011 16:46:26 -0500 Message-Id: <4DA33058020000250003C699@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Mon, 11 Apr 2011 16:46:16 -0500 From: "Kevin Grittner" To: "Saurabh Agrawal" , Subject: Re: Postgres 9 slave lag References: In-Reply-To: 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=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/96 X-Sequence-Number: 37277 Saurabh Agrawal wrote: > max_standby_archive_delay = -1 > > I noticed that whenever long running query executes on slave, > slave starts lagging by master and as soon as query completes log > files get applied immediately. Please help how can I avoid slave > lag. You can adjust max_standby_archive_delay to the maximum amount of time you want replication to block waiting for your query. If that is exceeded, your query will be canceled to allow replication to continue. http://www.postgresql.org/docs/9.0/interactive/hot-standby.html#HOT-STANDBY-CONFLICT -Kevin