Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 4363B133616B for ; Wed, 17 Nov 2010 19:56:59 -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 56292-10 for ; Wed, 17 Nov 2010 23:56:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 2299E1337B4F for ; Wed, 17 Nov 2010 19:56:52 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id oAHNuifA027474; Wed, 17 Nov 2010 18:56:44 -0500 (EST) To: Josh Berkus cc: postgres performance list Subject: Re: Anyone seen this kind of lock pileup? In-reply-to: <4CE46856.7070006@agliodbs.com> References: <4CE412F4.4090101@agliodbs.com> <24934.1290031132@sss.pgh.pa.us> <4CE46856.7070006@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Wed, 17 Nov 2010 15:42:14 -0800" Date: Wed, 17 Nov 2010 18:56:44 -0500 Message-ID: <27473.1290038204@sss.pgh.pa.us> From: Tom Lane 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: 201011/311 X-Sequence-Number: 41335 Josh Berkus writes: > Ok, I've collected more data. Looks like the case I was examining was > idiosyncratic; most of these lock pile-ups involve 400 or more locks > waiting held by around 20 different backends. Given this, taking 3 > seconds to sort that all out doesn't seem that unreasonable. > Presumably there's a poll cycle of some sort for waiting statements? No ... but if the lock requests were mutually exclusive, I could believe it taking 3 seconds for all of the waiting backends to get their turn with the lock, do whatever they were gonna do, commit, and release the lock to the next guy. > Anyway, the obvious answer is for the user to fix their application. Probably. regards, tom lane