Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XJhkq-0008Nc-9Q for pgsql-performance@arkaria.postgresql.org; Tue, 19 Aug 2014 11:39:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XJhkp-00014n-Lp for pgsql-performance@arkaria.postgresql.org; Tue, 19 Aug 2014 11:39:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XJhko-00014g-EH for pgsql-performance@postgresql.org; Tue, 19 Aug 2014 11:39:06 +0000 Received: from nm5-vm2.bullet.mail.ne1.yahoo.com ([98.138.90.153]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XJhke-0000Kl-U3 for pgsql-performance@postgresql.org; Tue, 19 Aug 2014 11:39:05 +0000 Received: from [98.138.100.116] by nm5.bullet.mail.ne1.yahoo.com with NNFMP; 19 Aug 2014 11:38:53 -0000 Received: from [98.138.88.238] by tm107.bullet.mail.ne1.yahoo.com with NNFMP; 19 Aug 2014 11:38:53 -0000 Received: from [127.0.0.1] by omp1038.mail.ne1.yahoo.com with NNFMP; 19 Aug 2014 11:38:53 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 59733.13344.bm@omp1038.mail.ne1.yahoo.com Received: (qmail 75148 invoked by uid 60001); 19 Aug 2014 11:38:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s1024; t=1408448332; bh=RLIg06JoU7C/cP9XCxzhhZEOQl6VKDSgL0OqJmUQzW8=; h=References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=u6VOD33mIRTy6opK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BoYXZlIGZvdW5kIHRoYXQgd2UgcnVuIG91dCBvZiBzaGFyZWQKPj4.IG1lbW9yeSB3aGVuIG1heF9wcmVkX2xvY2tzX3Blcl90cmFuc2FjdGlvbiBpcyBsZXNzIHRoYW4gMzBrLgo.Cj4.IEl0IGdhdGhlcnMgdGhlIGluZm9ybWF0aW9uIGkBMAEBAQE- X-Mailer: YahooMailWebService/0.8.201.700 References: <1408399307.93048.YahooMailNeo@web122304.mail.ne1.yahoo.com> <12486.1408404273@sss.pgh.pa.us> Message-ID: <1408448332.31825.YahooMailNeo@web122302.mail.ne1.yahoo.com> Date: Tue, 19 Aug 2014 04:38:52 -0700 From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: query against pg_locks leads to large memory alloc To: Tom Lane Cc: Dave Owens , Merlin Moncure , Matheus de Oliveira , postgres performance list In-Reply-To: <12486.1408404273@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Tom Lane wrote: > Kevin Grittner writes: >> Dave Owens wrote: >>> max_connections =3D 450 ...we have found that we run out of shared >>> memory when max_pred_locks_per_transaction is less than 30k. > >> It gathers the information in memory to return for all those locks >> (I think both the normal heavyweight locks and the predicate locks >> do that).=A0 450 * 30000 is 13.5 million predicate locks you could >> have, so they don't need a very big structure per lock to start >> adding up.=A0 I guess we should refactor that to use a tuplestore, so >> it can spill to disk when it gets to be more than work_mem. > > Seems to me the bigger issue is why does he need such a huge > max_pred_locks_per_transaction setting?=A0 It's hard to believe that > performance wouldn't tank with 10 million predicate locks active. > Whether you can do "select * from pg_locks" seems pretty far down > the list of concerns about this setting. It would be interesting to know more about the workload which is capable of that, but it would be a lot easier to analyze what's going on if we could look at where those locks are being used (in summary, of course -- nobody can make sense of 10 million detail lines).=A0 About all I can think to ask at this point is: how many total tables and indexes are there in all databases in this cluster (counting each partition of a partitioned table as a separate table)?=A0 With the promotion of finer-grained locks to courser ones this should be pretty hard to hit without a very large number of tables. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance