Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 58064B5D91F for ; Fri, 4 Nov 2011 13:27:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 30187-01 for ; Fri, 4 Nov 2011 16:27:07 +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 64152B5DBC1 for ; Fri, 4 Nov 2011 13:27:06 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Fri, 04 Nov 2011 11:27:05 -0500 Message-Id: <4EB3CC010200002500042A53@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Fri, 04 Nov 2011 11:26:57 -0500 From: "Kevin Grittner" To: "Claudio Freire" , "Tom Lane" Cc: "postgres performance list" Subject: Re: Blocking excessively in FOR UPDATE References: <6734.1320345936@sss.pgh.pa.us> <19908.1320363946@sss.pgh.pa.us> 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=-3.101 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-1.201 X-Spam-Level: X-Archive-Number: 201111/81 X-Sequence-Number: 45592 Claudio Freire wrote: > Now, I'm thinking those writes are catching the DB at a bad moment - > we do have regular very write-intensive peaks. > > Maybe I should look into increasing shared buffers? As already pointed out, SELECT FOR UPDATE will require a disk write of the tuple(s) read. If these are glutting, increasing shared_buffers would tend to make things worse. You might want to make the background writer more aggressive or *reduce* shared_buffers to better spread the output. Hopefully you have a BBU RAID controller configured for write-back. If not you should. If you do, another thing which might help is increasing the cache on that controller. Or you could move WAL to a separate file system on a separate controller with its own BBU write-back cache. -Kevin