Re: Pre-forking backend - Mailing list pgsql-hackers

From Ken Hirsch
Subject Re: Pre-forking backend
Date
Msg-id 00f601c1492a$9443a600$87863dd0@hppav
Whole thread Raw
In response to Re: Pre-forking backend  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Tom Lane wrote:
>
> This approach would only work as far as saving the fork() call itself,
> not the backend setup time.  Not sure it's worth the trouble.  I doubt
> that the fork itself is a huge component of our start time; it's setting
> up all the catalog caches and so forth that's expensive.

On Unix, yeah, but on Windows, VMS, MPE/iX, possibly others, forking is
expensive.  Even on Unix, you're not losing anything by this architecture.

The simple solution is to have wait on separate sockets and add a redirect
capability to the protocol.  The program would be:

If the clients wants the database I have open, great, we're in business
else if the client supports redirect, do redirect
else if I can pass file descriptor on this OS, pass file descriptor to the right process
else throw away what we've done and open the right database.

Simple!  It's just a small matter of programming.






pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Pre-forking backend
Next
From: Peter Eisentraut
Date:
Subject: Re: Glitch in handling of postmaster -o options