From: Frank Joerdens <frank@joerdens.de>
To: Frank Bax <fbax@sympatico.ca>
Cc: Chris Ruprecht <chrup999@yahoo.com>
Cc: PostGreSQL PHP Group <pgsql-php@postgresql.org>
Subject: Re: pg_pconnect - ??
Date: Sat, 2 Feb 2002 17:41:38 +0100
Message-ID: <20020202174138.A8112@superfly.archi-me-des.de> (raw)
In-Reply-To: <3.0.6.32.20020128141957.02130660@pop6.sympatico.ca>
References: <p0510120cb87b23a62b3d@[192.168.0.6]>
<3.0.6.32.20020128141957.02130660@pop6.sympatico.ca>
On Mon, Jan 28, 2002 at 02:19:57PM -0500, Frank Bax wrote:
> The connection will only be reused if the *same* apache child process
> handles the request.
IMHO, also if another apache child handles the request which also has a
connection open to the same database using the same connection string.
[ . . . ]
> If your postgres database is on the same server as you webserver, there is
> neglible gains for using pconnect over connect.
Not exactly true, I think. A while ago I started a thread about using
Unix sockets vs. TCP sockets because I had trouble getting Unix sockets
to work on Solaris. It emerged from the discussion that the added
overhead vis-a-vis local sockets of going through the TCP/IP stack was
completely negligible compared to all the other stuff that is going on
when making, or reusing, a (persistent or non-persistent) db connection.
I should think that with a fast, non-saturated network, the fact that
you then add a physical (e.g. Ethernet) layer to the scenario would not
matter much either. I recently split webserver and db server here
(basically to make administration less of a headache because I had
Postgres servers running on 2 different boxes, for Intranet and
Internet), and put the databases from the Postgres server running on the
webserver (an old Dual PPro 200) onto a somewhat newer, 2nd box (Dual
PII 400). It makes quite a difference, speed-wise, which would support
my line of reasoning. I didn't try to measure this scientifically (or
pseudo-scientifically, for that matter).
Whether you get a performance gain from using pconnect over connect
depends on whether you use simple queries (connection overhead is large
compared to query execution time) or complex queries (connection
overhead is small compared to query execution time). It has little to
do, IMHO, with whether you go throug local sockets or TCP/IP sockets, or
if your Postgres server is on the same physical machine as your
webserver.
Regards, Frank
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: frank@joerdens.de, fbax@sympatico.ca, chrup999@yahoo.com
Subject: Re: pg_pconnect - ??
In-Reply-To: <20020202174138.A8112@superfly.archi-me-des.de>
References: <p0510120cb87b23a62b3d@[192.168.0.6]> <3.0.6.32.20020128141957.02130660@pop6.sympatico.ca> <20020202174138.A8112@superfly.archi-me-des.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox