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

From mlw
Subject Re: Pre-forking backend
Date
Msg-id 3BB617F1.BBA5BCFF@mohawksoft.com
Whole thread Raw
In response to Pre-forking backend  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian wrote:
> 
> How hard would it be to pre-fork an extra backend for the database a
> user just requested so if they next user asks for the same database, the
> backend would already be started?

The only problem I could see is the socket. The pre-forked() back-end would
have to do the accept() for the new connection, but you could always have a
forked process waiting to go in the accept() routine. When it accepts a new
socket, it sends a signal off to the parent back-end to fork() over (couldn't
resist) a new backend.

That way there would be no fork() over head for new connections.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Pre-forking backend
Next
From: Bruce Momjian
Date:
Subject: Re: Spinlock performance improvement proposal