Re[2]: [HACKERS] Re: PHPBuilder article -- Postgres vs MySQL

From: Alexey Borzov <borz_off(at)rdw(dot)ru>
To: The Hermit Hacker <scrappy(at)hub(dot)org>
Cc: Charles Tassell <ctassell(at)isn(dot)net>, Adam Lang <aalang(at)rutgersinsurance(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re[2]: [HACKERS] Re: PHPBuilder article -- Postgres vs MySQL
Date: 2000-11-17 08:36:01
Message-ID: 1172372667.20001117113601@rdw.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Haväng 2000-11-17 10:40:39 Problem with transaction
Previous Message The Hermit Hacker 2000-11-17 06:33:06 Re: [HACKERS] Re: PHPBuilder article -- Postgres vs MySQL

Browse pgsql-hackers by date

  From Date Subject
Next Message Grant Finnemore 2000-11-17 09:05:34 Re: Failure to recognise new database
Previous Message Tom Lane 2000-11-17 07:35:08 Re: Failure to recognise new database