Re: PHP and persistent connections
От | Andrew McMillan |
---|---|
Тема | Re: PHP and persistent connections |
Дата | |
Msg-id | 3A1CDCD4.F4FB5F4F@catalyst.net.nz обсуждение исходный текст |
Ответ на | PHP and persistent connections (GH <grasshacker@over-yonder.net>) |
Список | pgsql-novice |
GH wrote: > > I remember seeing something about issues with PHP > using Postgrs persistent connections. I have been unable to find anything > in the archives. > > I have been having a problem where backend processes become dedicated to > a persistent connection and do not die. I do not know if this is caused > by something in PHP or not. > > I am using pg_pconnect for the connections. > Is there a solution to this? > (By the way, kill-ing the backends is NOT a solution. ;-)) > > This is running 7.0.2 on FreeBSD 4.0-RELEASE and PHP 4.0.3pl1. > > Any suggestions? > Eventually, the maximum number of backends is started and the message > "Sorry, too many clients..." is displayed. > > I thank you all for your assistance. Each Apache process which does the pconnect will spawn a PostgreSQL process to handle the connection. That connection will remain active for the life of the Apache process, which can naturally be quite long. This is what persistent connections are. If you only want it active for the life of the PHP script then you don't want persistent connections at all! If you have your numbers for Apache processes set quite high you can very easily run into maximum back-ends limits and also into maximum open files limits. These two are adjustable however, with PostgreSQL controlling the maximum clients through a command-line parameter, and your operating system controlling the maximum open files through however FreeBSD does that. And of course, Apache can control the maximum numbers of processes started as well. Regards, Andrew. -- _____________________________________________________________________ Andrew McMillan, e-mail: Andrew@cat-it.co.nz Catalyst IT Ltd, PO Box 10-225, Level 22, 105 The Terrace, Wellington Me: +64 (21) 635 694, Fax: +64 (4) 499 5596, Office: +64 (4) 499 2267
В списке pgsql-novice по дате отправления: