Re[2]: [HACKERS] Re: PHPBuilder article -- Postgres vs MySQL - Mailing list pgsql-general

From Alexey Borzov
Subject Re[2]: [HACKERS] Re: PHPBuilder article -- Postgres vs MySQL
Date
Msg-id 1172372667.20001117113601@rdw.ru
Whole thread Raw
In response to Re: [HACKERS] Re: PHPBuilder article -- Postgres vs MySQL  (The Hermit Hacker <scrappy@hub.org>)
List pgsql-general
Greetings, The Hermit Hacker!

  Well, there's a problem with PHP's [mis]documentation. First of all,
it counts open DB connections not on per-webserver, but on
per-process/thread basis.
  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().


Hell, I never thought I'll give advice to one of PgGurus. ;]

At 16.11.2000, 11:21, you wrote:
THH> I run PHP4 and IMP (http://www.horde.org) and we've gotten then to remove
THH> the useof pg_pconnect() since it is broken.  Broken how, you might
THH> ask?  Well, I ran on a standalone machine, no other web users but myself,
THH> to test, and each tim eI hit the database with IMP,. it opened a new
THH> backend, but it never reused old, idle ones ... eventually, you run out of
THH> the ability to connect since you've locked up all connections ...
--
Yours, Alexey V. Borzov, Webmaster of RDW



pgsql-general by date:

Previous
From: "Arun Prasad"
Date:
Subject: About arrays in plpgsql.
Next
From: Alexander Haväng
Date:
Subject: Problem with transaction