Re: Spinlock performance improvement proposal - Mailing list pgsql-hackers

From mlw
Subject Re: Spinlock performance improvement proposal
Date
Msg-id 3BB23DD6.E86AF327@mohawksoft.com
Whole thread Raw
In response to Re: Spinlock performance improvement proposal  ("D. Hageman" <dhageman@dracken.com>)
Responses Re: Spinlock performance improvement proposal
Re: Spinlock performance improvement proposal
List pgsql-hackers
"D. Hageman" wrote:

> The plan for the new spinlocks does look like it has some potential.  My
> only comment in regards to permformance when we start looking at SMP
> machines is ... it is my belief that getting a true threaded backend may
> be the only way to get the full potential out of SMP machines.  I see that
> is one of the things to experiment with on the TODO list and I have seen
> some people have messed around already with this using Solaris threads.
> It should probably be attempted with pthreads if PostgreSQL is going to
> keep some resemblance of cross-platform compatibility.  At that time, it
> would probably be easier to go in and clean up some stuff for the
> implementation of other TODO items (put in the base framework for more
> complex future items) as threading the backend would take a little bit of
> ideology shift.

I can only think of two objectives for threading. (1) running the various
connections in their own thread instead of their own process. (2) running
complex queries across multiple threads.

For  item (1) I see no value to this. It is a lot of work with no tangible
benefit. If you have an old fashion pthreads implementation, it will hurt
performance because are scheduled within the single process's time slice.. If
you have a newer kernel scheduled implementation, then you will have the same
scheduling as separate processes. The only thing you will need to do is
switch your brain from figuring out how to share data, to trying to figure
out how to isolate data. A multithreaded implementation lacks many of the
benefits and robustness of a multiprocess implementation.

For item (2) I can see how that could speed up queries in a low utilization
system, and that would be cool, but in a server that is under load, threading
the queries probably be less efficient.



pgsql-hackers by date:

Previous
From: "Mitch Vincent"
Date:
Subject: Re: casting for dates
Next
From: Ryan Mahoney
Date:
Subject: Re: casting for dates