Well, there are some problems, indeed.
1) PHP counts connections on a per-process basis. So, when you have,
say, 10 httpd processes, and a limit of 10 connections is set in
php.ini, you can have total of 100 postgres backends, with a default
limit of 32.
2) PHP does not reuse persistent connections when it can open a new
one. So set a limit of pconnections to 1 or 2 in php.ini, and
everything will work as intended.
At 06.12.2000, 14:43, you wrote:
HP> I have some troubles with the pg_pconnect function ...
HP> All my PHP scripts are using pg_pconnect but apache seems to not using
HP> the persistent connection ... ?
HP> I mean that when I make a small script usign a pg_pconnect, and a simple
HP> select ... I open 2 browsers and call many time my scrip, I look for the
HP> backends of postgresql and I see many backends opened !
HP> If I try for example to limit the backend to 35, and run an ab (apache
HP> bench) to call the page ... after the 35 connections opened postgresql
HP> say there is no more connection possible ... ok ! but why the
HP> persistents connexions are not re-used ?
Yours, Alexey V. Borzov, Webmaster of RDW
In response to
pgsql-php by date
|Next:||From: Aarmel||Date: 2000-12-08 07:25:14|
|Subject: persistant connections?|
|Previous:||From: Hervé Piedvache||Date: 2000-12-06 11:29:00|
|Subject: pg_pconnect - Really persistent ?|