Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 6E5BC1337B4F for ; Wed, 17 Nov 2010 19:42:35 -0400 (AST) 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 95816-08 for ; Wed, 17 Nov 2010 23:42:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from glacier.frostconsultingllc.com (glacier.frostconsultingllc.com [69.36.227.170]) by mail.postgresql.org (Postfix) with ESMTP id 19756133616B for ; Wed, 17 Nov 2010 19:42:28 -0400 (AST) Received: from dsl081-245-111.sfo1.dsl.speakeasy.net ([64.81.245.111] helo=Sidney-Stratton.local) by glacier.frostconsultingllc.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.69) (envelope-from ) id 1PIrdw-0001Qt-Iz; Wed, 17 Nov 2010 15:42:27 -0800 Message-ID: <4CE46856.7070006@agliodbs.com> Date: Wed, 17 Nov 2010 15:42:14 -0800 From: Josh Berkus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2 MIME-Version: 1.0 To: Tom Lane CC: postgres performance list Subject: Re: Anyone seen this kind of lock pileup? References: <4CE412F4.4090101@agliodbs.com> <24934.1290031132@sss.pgh.pa.us> In-Reply-To: <24934.1290031132@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201011/309 X-Sequence-Number: 41333 >> What's odd about this is that the resulting "lock pileup" takes a >> mysterious 2-3.5 seconds to clear, despite the fact that none of the >> connections are *doing* anything during that time, nor are there >> deadlock errors. In theory at least, the locks should clear out in >> reverse order in less than a second; none of the individual statements >> takes more than 10ms to execute. 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? Anyway, the obvious answer is for the user to fix their application. -- -- Josh Berkus PostgreSQL Experts Inc. http://www.pgexperts.com