Re: persistent vs. non-persistent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



--- Chris Ruprecht <chrup999@xxxxxxxxx> 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


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux