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

From Bruce Momjian
Subject Re: Pre-forking backend
Date
Msg-id 200110121629.f9CGTRv03399@candle.pha.pa.us
Whole thread Raw
In response to Re: Pre-forking backend  (Doug McNaught <doug@wireboard.com>)
Responses Re: Pre-forking backend
List pgsql-hackers
> Gavin Sherry <swm@linuxworld.com.au> writes:
> 
> > This aside, isn't it possible to just copy the socket and some
> > data about the database required into shared memory and have the preforked
> > children pick the socket up from there.
> 
> Ummm....  No.  There's no Unix API for doing so.
> 
> You can pass open file descriptors across Unix domain sockets on most
> systems, which is a possible way to address the problem, but probably
> not worth it for the reasons discussed earlier.

OK, let's assume we have pre-forked backends that do the accept().  One
enhancement would be for the child to connect to the last requested
database.  If the accept() user wants the same database, it is already
connected, or at least its cache is loaded.  If they want another one,
we can disconnect and connect to the database they request.  This would
be portable for all OS's because there is no file descriptor passing.

Added to TODO:

* Have pre-forked backend pre-connect to last requested database or pass file descriptor to backend pre-forked for
matchingdatabase
 
--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: New contrib/tsearch module for 7.2
Next
From: Tatsuo Ishii
Date:
Subject: Re: Unicode combining characters