Re: Pre-forking backend

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Doug McNaught <doug(at)wireboard(dot)com>
Cc: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, sean-pgsql-hackers(at)chittenden(dot)org, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Pre-forking backend
Date: 2001-10-12 16:29:27
Message-ID: 200110121629.f9CGTRv03399@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Gavin Sherry <swm(at)linuxworld(dot)com(dot)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 matching database

--
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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2001-10-12 16:47:41 SQL99 time zones
Previous Message Bruce Momjian 2001-10-12 16:19:52 Re: Pre-forking backend