Re: To many connections Error - Mailing list pgsql-general

From scott.marlowe
Subject Re: To many connections Error
Date
Msg-id Pine.LNX.4.33.0212180856490.3136-100000@css120.ihs.com
Whole thread Raw
In response to To many connections Error  (David Siebert <david@eclipsecat.com>)
Responses Re: To many connections Error  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
List pgsql-general
On Wed, 18 Dec 2002, David Siebert wrote:

> I am getting an error message that says that there are too many connections.
> There is maybe 20 people logged on and I have max connections set to 32.
> Any suggestions?

Let me guess, you're running PHP and using pg_pconnect?

Bad idea, unless you know exactly what you are doing.

I suggest one of two solutions.

1:  Discontinue use of pg_pconnect.  Performance gains from pg_pconnect
aren't that great on a lightly loaded system and the inherent problems
that pg_pconnect can produce are much worse than any small performance
gain you might see.

2:  If you really need pg_pconnect, then you have to configure your apache
web server and your postgresql database the right way.

assuming a single db and a single apache server, you need to edit the
apache server's httpd.conf file to change the MaxClients value to be LESS
than whatever you set the max children in postgresql to.  Postgresql
defaults to 32, while apache defaults to 150.  Also, leave some breathing
room for other access methods (ODBC, psql etc...)

Most setups will run fine with something like this:

postgresql.conf:
max_connections = 64

httpd.conf:
MaxClients 50


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: SELECT EXTRACT doesn't work with variables?
Next
From: Tom Lane
Date:
Subject: Re: Linux folders permission - postgresql