Re: Pre-forking backend

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Pre-forking backend
Date: 2001-09-30 04:40:49
Message-ID: 200109300440.f8U4ens04815@saturn.jw.home
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.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gavin Sherry 2001-09-30 10:12:20 Re: Pre-forking backend
Previous Message Tom Lane 2001-09-30 02:56:39 Re: Glitch in handling of postmaster -o options