Re: persistent vs. non-persistent

From: "Brent R(dot) Matzelle" <bmatzelle(at)yahoo(dot)com>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: persistent vs. non-persistent
Date: 2001-10-02 16:06:33
Message-ID: 20011002160633.57751.qmail@web13007.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

--- Chris Ruprecht <chrup999(at)yahoo(dot)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

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Andrew McMillan 2001-10-02 19:27:07 Re: persistent vs. non-persistent
Previous Message Chris Ruprecht 2001-10-02 15:02:47 Re: persistent vs. non-persistent