Re: Pre-forking backend

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Doug McNaught <doug(at)wireboard(dot)com>, 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-13 18:14:19
Message-ID: Pine.LNX.4.30.0110122210460.648-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian writes:

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

This is bad because you have hidden "connection pooling" that cannot be
circumvented, and I guarantee that it will become a problem because "new
connection" will no longer equal "new connection". Additionally, you're
assuming a setup were any new connection will connect to a random (from
the server's point of view) database. I claim these setups are not the
majority. In fact, any one client application would usually only connect
to exactly one database, so it might as well keep that connection open.
For systems were this is not possible for some reason or where different
databases or connection parameters are really required, there are already
plenty of solutions available that are tuned or tunable to the situation
at hand, so your solution would just get in the way. In short, you're
adding a level of complexity where there is no problem.

> Added to TODO:

I haven't seen a consensus yet.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-10-13 18:15:16 Recursive SQL functions
Previous Message Peter Eisentraut 2001-10-13 18:13:54 Re: pg_client_encoding