Re: Too many clients----A big problem for my team - Mailing list pgsql-admin

From Steve Crawford
Subject Re: Too many clients----A big problem for my team
Date
Msg-id 200503080849.18471.scrawford@pinpointresearch.com
Whole thread Raw
In response to Too many clients----A big problem for my team  ("ganapatiram" <ganapatiram@symphonydata.com>)
List pgsql-admin
>            I work with postgresql 8.0 version. I have a team of 14
> developers. When all the team connects the DB i see this error very
> very frequently which is a severe problem for me and team all the
> day. The error is:
>
> Please report this exception: java.sql.SQLException: FATAL:  sorry,
> too many clients already
...
>         I have max_connections=200 and i have 5 users for my DB. I
> dont understand what to do in order to resolve this...

What is your _server_ telling you?

Check the logs.

Check ps for instances of postgres.

Check netstat for connections to PG and track back to the source point
of each of the connections.

Keep a connection open to your server so you can run "select * from
pg_stat_activity;" to see what queries are running.

You will probably find:

1) Your app is lying to you or is connecting to a different server
than you assumed if you have multiple servers.

2) You don't really have 200 connections (did you restart after
changing your config?)

3) Your app is making more connections than you think. (Doing any
pooling??)

4) Your apps aren't closing connections that you thought were being
closed.

Cheers,
Steve

pgsql-admin by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: help!!!!!!
Next
From: "Joel Fradkin"
Date:
Subject: graphical tools