Search Postgresql Archives

Re: Postgres PHP error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/02/2012 09:18 PM, rahul143 wrote:
Hi All

Im receiving the following error, on a php page, conneting to postgres 7.4,
installed on Mandrake 10.0
<snip>
Error Description: pg_connect(): Unable to connect to PostgreSQL server:
FATAL: sorry, too many clients already .
</snip>
Can anyone tell me what this means?
Is there a performance setting I need to set under the postgresql conf file.
I have checked, and its set to 100 users.
This error strangely has only happened once. Last week Monday.

It means you had 100 clients connected to your PostgreSQL server which was set to a max of 100 clients thus all new attempts failed. It's not strange at all to see this only intermittently - it merely requires something that delays the processing of requests from your web-app. An easy example is a query that locks a critical table long enough for 100 connections from the web app to build up. Or your database server could have been briefly too busy to handle the incoming queries fast enough.

Don't just increase the max clients setting. You need to diagnose the cause (maintenance query that shouldn't have been run during heavy use periods, inadequate hardware, app failing to close connections properly or quickly enough, bad database tuning, etc.) before prescribing a cure (procedure change, new hardware, better tuning, connection pooling, query caching, etc.).

Cheers,
Steve



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux