Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 595596350CB for ; Wed, 18 Mar 2009 04:54:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 75319-01-6 for ; Wed, 18 Mar 2009 04:54:42 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail128067.authsmtp.com (outmail128067.authsmtp.com [62.13.128.67]) by mail.postgresql.org (Postfix) with ESMTP id B6B0A63575E for ; Wed, 18 Mar 2009 04:53:56 -0300 (ADT) Received: from mail-c193.authsmtp.com (mail-c193.authsmtp.com [62.13.128.118]) by punt10.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n2I7rqct056277; Wed, 18 Mar 2009 07:53:52 GMT Received: from [192.168.0.2] (85-211-223-92.dyn.gotadsl.co.uk [85.211.223.92]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n2I7ro1n021896; Wed, 18 Mar 2009 07:53:51 GMT Subject: Re: Proposal of tunable fix for scalability of 8.4 From: Simon Riggs To: Matthew Wakeling Cc: "pgsql-performance@postgresql.org" In-Reply-To: References: <603c8f070903121829r31cf1472ha9876e5c480a542e@mail.gmail.com> <12292.1236964604@sss.pgh.pa.us> <49BB699D.1070809@enterprisedb.com> Content-Type: text/plain Date: Wed, 18 Mar 2009 07:53:53 +0000 Message-Id: <1237362833.3953.186.camel@ebony.2ndQuadrant> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Server-Quench: eba6a0ad-1391-11de-8a51-002264978518 X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksadBtFaQ1bYFhD HGQLW11EUFp7XGB/ bgsfZQBDYEtPQQdo U1ZAQE1QEQdtHhxP WBxnVVstdltGen94 bEAsX3dcWwovJxd7 E04FQXAHZm5hdWEe BBVFf1JRcR5Kfh1H bFR2U3sIYG1JBC9q VzwLEgofGg96HWxt WAYVKkkbRQ4MEHYg WhYLFzEiVUMEV209 KAZuMVUVGE8bM0Ez LUppXlxQY1lOYiwg X-Authentic-SMTP: 61633235383639.pelican.dmpriest.net.uk:1378/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200903/242 X-Sequence-Number: 33164 On Mon, 2009-03-16 at 16:26 +0000, Matthew Wakeling wrote: > One possibility would be for the locks to alternate between exclusive > and > shared - that is: > > 1. Take a snapshot of all shared waits, and grant them all - > thundering > herd style. > 2. Wait until ALL of them have finished, granting no more. > 3. Take a snapshot of all exclusive waits, and grant them all, one by > one. > 4. Wait until all of them have been finished, granting no more. > 5. Back to (1) I agree with that, apart from the "granting no more" bit. Currently we queue up exclusive locks, but there is no need to since for ProcArrayLock commits are all changing different data. The most useful behaviour is just to have two modes: * exclusive-lock held - all other x locks welcome, s locks queue * shared-lock held - all other s locks welcome, x locks queue This *only* works for ProcArrayLock. -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support