Re: [Phplib-users] pgsql - too many clients?
Brought to you by:
nhruby,
richardarcher
|
From: Matthias M. <m....@in...> - 2001-11-21 16:46:16
|
hello, if you really need the performance you gain using pconnect instead of connect (especially when your database is running on another host, than you webserver) another approach could be setting the apache-config-value for MaxRequestsPerChild. AFAIR it defaults to 0 which means unlimited requests per child. if so apache would *never* free you pgsql-handles. if you put it to a value greater 0 every apache child-process dies after an finite number of requests and frees you psql-connections (sucking up a bit performance you gained using pconnect, since the webserver-child-process has to be restarted). also: if you keep using pconnect(), you maybe have to raise the number of max-backends of your pgsql-postmaster. keep in mind that you can get number-of-apache-childs times number-of-databases times number-of-database-logins as the total number of simultanous pgsql-connection. regards messju mohr On Wed, 21 Nov 2001, Stephen Woodbridge wrote: > I had a similar problem with mysql and apache. > > Apache does something weird when you pconnect where it never releases or > reuses your connections. > > I fixed this on my sysem by changing pconnect to connect. Find your call > to pg_pconnect and change it to pg_connect in phplib and see if it fixes > your problem. You may also need to restart pgsql to purge all the open > pconnections > > -Steve > > Frank Bax wrote: > > > > pgsql 7.1 - phplib 7.2d - OpenBSD 2.9 > > > > How do I fix this? > > > > Warning: Unable to connect to PostgreSQL server: Sorry, too many clients > > already in /var/www/php/class/phplib-7.2d/db_pgsql.inc on line 48 > > Database error: Link-ID == false, pconnect failed > > PostgreSQL Error: 0 () > > Session halted. > > > > _______________________________________________ > > Phplib-users mailing list > > Php...@li... > > https://lists.sourceforge.net/lists/listinfo/phplib-users > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > > -- Matthias Mohr <m....@in...> (Software-Entwicklung) Internet Factory AG, Niederlassung Industriestr. 11, 26121 Oldenburg Tel: (+49) (0)441 - 77 92 10 Fax: (+49) (0)441 - 77 92 177 http://www.internet-factory.de |