Re: Pre-forking backend

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Pre-forking backend
Date: 2001-10-12 16:19:52
Message-ID: 200110121619.f9CGJq402778@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Tom Lane wrote:
> > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > > How hard would it be to pre-fork an extra backend
> >
> > How are you going to pass the connection socket to an already-forked
> > child process? AFAIK there's no remotely portable way ...
>
> One of the mechanisms I've seen was that the master process
> just does the socket(), bind(), listen(), than forks off and
> the children coordinate via a semaphore that at most one of
> them executes a blocking accept(). I think it was in some
> older apache release.
>
> But in contrast to apache, we currently do most of the
> initialization after we authenticated the user and know what
> database to connect to. I'm not sure how much of the backend
> startup could be done before accepting the connection.

I agree this may not be a big win on most platforms, but for platforms
like Solaris and NT, it could be a big win. Added to TODO:

* Do listen() in postmaster and accept() in pre-forked backend

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-10-12 16:29:27 Re: Pre-forking backend
Previous Message Bruce Momjian 2001-10-12 16:13:24 Re: optimizer question