pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jignesh K. Shah <J.K.Shah@Sun.COM>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Scott Carey <scott@richrelevance.com>
Cc: Greg Smith <gsmith@gregsmith.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: Thu, 19 Mar 2009 19:12:18 -0400
Message-ID: <49C2D152.8050509@sun.com> (raw)
In-Reply-To: <603c8f070903191349p5e8fb00as2816581d584fcefd@mail.gmail.com>
References: <603c8f070903121829r31cf1472ha9876e5c480a542e@mail.gmail.com>
	<C5E680C6.3790%scott@richrelevance.com>
	<603c8f070903181425r6fff6f7eq11e2dac6e867a7d0@mail.gmail.com>
	<49C17190.9050003@sun.com>
	<603c8f070903191349p5e8fb00as2816581d584fcefd@mail.gmail.com>



Robert Haas wrote:
>> Actually the patch I submitted shows no overhead from what I have seen and I
>> think it is useful depending on workloads where it can be turned on  even on
>> production.
>>     
>
> Well, unless I'm misunderstanding something, waking all waiters every
> time could lead to arbitrarily long delays for writers on mostly
> read-only workloads... and by arbitrarily along, we mean to say
> "potentially just about forever".  That doesn't sound safe for
> production to me.
>
>   

Hi Robert,
The patch I submmitted does not do any manipulation with the list. All 
it changes is gives the flexibility to change how many to wake up at one 
go. 0  is default which wakes up only 1 X (Exclusive)  at a time or all 
sequential S (Shared). Changing the value to 1 will wake up all 
sequential X or all sequential S as they are in the queue (no 
manipulation). Values 2 and higher upto 32 wakes up the next n waiter in 
the queue (X or S) AS they are in the queue. It absolutely does no 
manipulation and hence there is no overhead.  Absolutely safe for 
Production as Scott mentioned there are other things in postgresql.conf 
which can be more dangerous than this tunable.

>> I dont think anything is majorly wrong in my system.. Sometimes it is
>> PostgreSQL locks in play and sometimes it can be OS/system related locks in
>> play (network, IO, file system, etc).  Right now in my patch after I fix
>> waiting procarray  problem other PostgreSQL locks comes into play:
>> CLogControlLock, WALInsertLock , etc.  Right now out of the box we have no
>> means of tweaking something in production if you do land in that problem.
>> With the patch there is means of doing knob control to tweak the bottlenecks
>> of Locks for the main workload for which it is put in production.
>>     
>
> I'll reiterate my previous objection: I think your approach is too
> simplistic.  I think Tom said it the best: a lot of work has gone into
> making the locking mechanism lightweight and safe.  I'm pretty
> doubtful that you're going to find a change that is still safe, but
> performs much better.  The discussions by Heikki, Simon, and others
> about changing the way locks are used or inventing new kinds of locks
> seem much more promising to me.
>
>   
That is the beauty : The approach is simplistic but very effective. Lot 
of work has gone which is more incremental and this is another one of 
those incremental changes which allows minor tweaks which the workload 
may like very much and perform very well.. Performance tuning game is 
almost like harmonic frequency.  I agree that other kinds of locks seem 
more promising. I had infact proposed one last year  too:
http://archives.postgresql.org//pgsql-hackers/2008-06/msg00291.php

Seriously speaking a change will definitely cannot be done before 8.5 
time frame while this one is simple enough to go for 8.4.
The best thing one can contribute to the thread is to actually try the 
patch on the test system and run your own tests to see how it behaves.

-Jignesh

>> Right now.. the standard answer applies.. nope you are running the wrong
>> workload for PostgreSQL, use a connection pooler or your own application
>> logic. Or maybe.. you have too many users for PostgreSQL use some
>> proprietary database.
>>     
>
> Well I certainly agree that we need to get away from that mentality,
> although there's nothing particularly evil about a connection
> pooler... it might not be suitable for every workload, but you haven't
> specified why one couldn't or shouldn't be used in the situation
> you're trying to simulate here.
>
> ...Robert
>   



view thread (119+ messages)  latest in thread

Message-ID: <49C2D152.8050509@sun.com>
Permalink:  ../49C2D152.8050509@sun.com/
Also on:    postgresql.org/message-id/49C2D152.8050509@sun.com

 · 

reply

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: J.K.Shah@Sun.COM, robertmhaas@gmail.com, scott@richrelevance.com, gsmith@gregsmith.com, Kevin.Grittner@wicourts.gov
  Subject: Re: Proposal of tunable fix for scalability of 8.4
  In-Reply-To: <49C2D152.8050509@sun.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