Re: Pooling in Core WAS: Need help in performance tuning. - Mailing list pgsql-performance

From Tom Lane
Subject Re: Pooling in Core WAS: Need help in performance tuning.
Date
Msg-id 3774.1280293774@sss.pgh.pa.us
Whole thread Raw
In response to Re: Pooling in Core WAS: Need help in performance tuning.  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-performance
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Jul 27, 2010 at 9:56 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Other than the fork() cost itself and whatever authentication activity
>> there might be, practically all the startup cost of a new backend can be
>> seen as cache-populating activities. �You'd have to redo all of that,
>> *plus* pay the costs of getting rid of the previous cache entries.
>> Maybe the latter costs less than a fork(), or maybe not. �fork() is
>> pretty cheap on modern Unixen.

> I agree that the gain is minimal of itself; after all, how often do
> you need to switch databases, and what's the big deal if the
> postmaster has to fork a new backend?  Where I see it as a potentially
> big win is when it comes to things like parallel query.  I can't help
> thinking that's going to be a lot less efficient if you're forever
> forking new backends.

Color me unconvinced.  To do parallel queries with pre-existing worker
processes, you'd need to hook up with a worker that was (at least) in
your own database, and then somehow feed it the query plan that it needs
to execute.  I'm thinking fork() could easily be cheaper.  But obviously
this is all speculation (... and Windows is going to be a whole 'nother
story in any case ...)

            regards, tom lane

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Questions on query planner, join types, and work_mem
Next
From: Craig Ringer
Date:
Subject: Re: Pooling in Core WAS: Need help in performance tuning.