If used correctly, they will save resources on your system and improve
performance. To look out for is to make sure they are configured correctly.
Following is a previous email involving that topic:
From Alexey Borzov
Well, there's a problem with PHP's [mis]documentation. First of all,
it counts open DB connections not on per-webserver, but on
The default PHP config file has the limits of persistent and
non-persistent connections set to -1 (no limit)... Setting it to
some (supposedly) reasonable value (like, 50) accomplishes nothing: you
should multiply 50 by the number of webserver processes/threads. There
can be lots of them... :[
And then there comes PHP's "logic": if I can just open the new
connection, why bother reusing the old one? And thus Postgres backends
start multiplying like rabbits, eventually reaching the limit... :[
You should set a reasonable limit on number of open persistent
connections (like 1, maybe 2 or 3), only then PHP will actually reuse
them. My webserver now works with such setup and there are no more
problems with pg_pconnect().
Rutgers Casualty Insurance Company
----- Original Message -----
From: "Aarmel" <pgadmin(at)animated(dot)net(dot)au>
Sent: Friday, December 08, 2000 2:25 AM
Subject: [PHP] persistant connections?
> Can people give me a brief pro's and con's for persistant connections?
> Any major problems with them, such as ensureing they are closed for
In response to
pgsql-php by date
|Next:||From: Mark Christenson||Date: 2000-12-09 20:00:22|
|Subject: How to verify PHP has PostgreSQL support?|
|Previous:||From: Aarmel||Date: 2000-12-08 07:25:14|
|Subject: persistant connections?|