Re: Proposal of tunable fix for scalability of 8.4

From: "Jignesh K(dot) Shah" <J(dot)K(dot)Shah(at)Sun(dot)COM>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Scott Carey <scott(at)richrelevance(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Greg Smith <gsmith(at)gregsmith(dot)com>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Proposal of tunable fix for scalability of 8.4
Date: 2009-03-20 23:39:13
Message-ID: 49C42921.8050508@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Alvaro Herrera wrote:
> Alvaro Herrera escribió:
>
>
>> So Simon's correct.
>>
>
> And perhaps this explains why Jignesh is measuring an improvement on his
> benchmark. Perhaps an useful experiment would be to turn this behavior
> off and compare performance. This lack of measurement is probably the
> cause that the suggested patch to fix it was never applied.
>
> The patch is here
> http://archives.postgresql.org//pgsql-hackers/2004-11/msg00935.php
>
>
One of the reasons why my patch helps is it keeps this check intact but
allows other exclusive Wake up.. Now what PostgreSQL calls "Wakes" is
in reality just makes a variable indicating wake up and not really
signalling a process to wake up. This is a key point to note. So when
the process wanting the exclusive fights the OS Scheduling policy to
finally get time on the CPU then it check the value to see if it is
allowed to wake up and potentially due the delay between when some other
process marked that process "Waked up" and when the process check the
value "Waked up" it is likely that the lock is free (or other exclusive
process had the lock, did its work and releaed it ). Over it works well
since it lives within the logical semantics of the locks but just uses
various differences in OS scheduling and inherent delays in the system.

It actually makes sense if the process is on CPU wanting exclusive while
someone else is doing exclusive, let them try getting the lock rather
than preventing it from trying. The Lock semantic will make sure that
they don't issue exclusive locks to two process so there is no issue
with it trying.

It's late in Friday so I wont be able to explain it better but when load
is heavy, getting on CPU is an achievement, let them try an exclusive
lock while they are already there.

Try it!!

-Jignesh

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2009-03-21 00:37:20 Re: Need help with one query
Previous Message Frank Joerdens 2009-03-20 22:15:01 Re: Full statement logging problematic on larger machines?