From: Robert Haas <robertmhaas@gmail.com>
To: Scott Carey <scott@richrelevance.com>
Cc: Greg Smith <gsmith@gregsmith.com>
Cc: Jignesh K. Shah <J.K.Shah@sun.com>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Proposal of tunable fix for scalability of 8.4
Date: Wed, 18 Mar 2009 17:25:10 -0400
Message-ID: <603c8f070903181425r6fff6f7eq11e2dac6e867a7d0@mail.gmail.com> (raw)
In-Reply-To: <C5E680C6.3790%scott@richrelevance.com>
References: <603c8f070903121829r31cf1472ha9876e5c480a542e@mail.gmail.com>
<C5E680C6.3790%scott@richrelevance.com>
On Wed, Mar 18, 2009 at 1:43 PM, Scott Carey <scott@richrelevance.com> wrote:
>>> Its worth ruling out given that even if the likelihood is small, the fix is
>>> easy. However, I don¹t see the throughput drop from peak as more
>>> concurrency is added that is the hallmark of this problem < usually with a
>>> lot of context switching and a sudden increase in CPU use per transaction.
>>
>> The problem is that the proposed "fix" bears a strong resemblence to
>> attempting to improve your gas mileage by removing a few non-critical
>> parts from your card, like, say, the bumpers, muffler, turn signals,
>> windshield wipers, and emergency brake.
>
> The fix I was referring to as easy was using a connection pooler -- as a
> reply to the previous post. Even if its a low likelihood that the connection
> pooler fixes this case, its worth looking at.
Oh, OK. There seem to be some smart people saying that's a pretty
high-likelihood fix. I thought you were talking about the proposed
locking change.
>> While it's true that the car
>> might be drivable in that condition (as long as nothing unexpected
>> happens), you're going to have a hard time convincing the manufacturer
>> to offer that as an options package.
>
> The original poster's request is for a config parameter, for experimentation
> and testing by the brave. My own request was for that version of the lock to
> prevent possible starvation but improve performance by unlocking all shared
> at once, then doing all exclusives one at a time next, etc.
That doesn't prevent starvation in general, although it will for some workloads.
Anyway, it seems rather pointless to add a config parameter that isn't
at all safe, and adds overhead to a critical part of the system for
people who don't use it. After all, if you find that it helps, what
are you going to do? Turn it on in production? I just don't see how
this is any good other than as a thought-experiment.
At any rate, as I understand it, even after Jignesh eliminated the
waits, he wasn't able to push his CPU utilization above 48%. Surely
something's not right there. And he also said that when he added a
knob to control the behavior, he got a performance improvement even
when the knob was set to 0, which corresponds to the behavior we have
already anyway. So I'm very skeptical that there's something wrong
with either the system or the test. Until that's understood and
fixed, I don't think that looking at the numbers is worth much.
> I alluded to the three main ways of dealing with lock contention elsewhere.
> Avoiding locks, making finer grained locks, and making locks faster.
> All are worthy. Some are harder to do than others. Some have been heavily
> tuned already. Its a case by case basis. And regardless, the unfair lock
> is a good test tool.
In view of the caveats above, I'll give that a firm maybe.
...Robert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: robertmhaas@gmail.com, scott@richrelevance.com, gsmith@gregsmith.com, J.K.Shah@sun.com, Kevin.Grittner@wicourts.gov
Subject: Re: Proposal of tunable fix for scalability of 8.4
In-Reply-To: <603c8f070903181425r6fff6f7eq11e2dac6e867a7d0@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox