Re: Proposal of tunable fix for scalability of 8.4 - Mailing list pgsql-performance

From Tom Lane
Subject Re: Proposal of tunable fix for scalability of 8.4
Date
Msg-id 15144.1237408005@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposal of tunable fix for scalability of 8.4  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Proposal of tunable fix for scalability of 8.4
List pgsql-performance
Simon Riggs <simon@2ndQuadrant.com> writes:
> 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

My goodness, it seems people have forgotten about the "lightweight"
part of the LWLock design.

            regards, tom lane

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Extremely slow intarray index creation and inserts.
Next
From: Scott Carey
Date:
Subject: Re: Proposal of tunable fix for scalability of 8.4