Re: persistent vs. non-persistent - Mailing list pgsql-php

From Brent R. Matzelle
Subject Re: persistent vs. non-persistent
Date
Msg-id 20011002160633.57751.qmail@web13007.mail.yahoo.com
Whole thread Raw
In response to Re: persistent vs. non-persistent  ("Chris Ruprecht" <chrup999@yahoo.com>)
List pgsql-php
--- Chris Ruprecht <chrup999@yahoo.com> wrote:
> Brent,
>
> given, that you keep the connection open indefinitely, how do
> you use it?
>
> Do I go and $db = pg_pconnect(...); when I first start apache
> and then never
> do a connect again, unless I re-start apache?

Not quite.  When you run pg_pconnect() apache automatically
opens a PG connection and holds on to it until it dies or apache
is restarted.  However, in order to use that database connection
again, for each PHP page you will need to re-run pg_pconnect().
Then apache will look for any httpd processes that have an
identical open PG connection.  If there is one then it will use
that connection instead of creating a new one, thus saving you
the connection overhead.

You can read more about it here:
http://www.php.net/manual/en/features.persistent-connections.php

Brent

__________________________________________________
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com

pgsql-php by date:

Previous
From: "Chris Ruprecht"
Date:
Subject: Re: persistent vs. non-persistent
Next
From: Andrew McMillan
Date:
Subject: Re: persistent vs. non-persistent