Re: To many connections Error

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: David Siebert <david(at)eclipsecat(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: To many connections Error
Date: 2002-12-18 16:07:19
Message-ID: Pine.LNX.4.33.0212180856490.3136-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-12-18 16:10:58 Re: Linux folders permission - postgresql
Previous Message Tom Lane 2002-12-18 15:59:50 Re: SELECT EXTRACT doesn't work with variables?