Re: High-water Mark for number of sessions/connections reached in Postgres - Mailing list pgsql-admin

From Scott Marlowe
Subject Re: High-water Mark for number of sessions/connections reached in Postgres
Date
Msg-id AANLkTimkB3ymPmCj5rmJKY-7J_51J53pFTn44cj8By+k@mail.gmail.com
Whole thread Raw
In response to High-water Mark for number of sessions/connections reached in Postgres  ("Tomeh, Husam" <HTomeh@corelogic.com>)
Responses Re: High-water Mark for number of sessions/connections reached in Postgres  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-admin
On Fri, Aug 6, 2010 at 6:19 PM, Tomeh, Husam <HTomeh@corelogic.com> wrote:
> I was wondering if we can query/obtain the high-water mark of number of sessions or connections reached in a Postgres
database.Is there a view or command that can provide this information.  The pg_stat_database shows the current number
ofconnections, but not the high-water mark a database had reached. 

It's a pretty easy thing to approximate with a shell script.

while true;do ps ax|grep postgres:|grep -v grep|wc -l ;sleep 10;done >
connects.log &

then just tail the connects.log file.  It's a dirty hack and it'll be
a few counts over due to counting the postmaster and a few other
processes, but it'll give you a good idea of what your system is
doing.  Add a date in there if you need to know the time it was
happening.

pgsql-admin by date:

Previous
From: "Burgholzer, Robert (DEQ)"
Date:
Subject: Re: catalog corruption causes
Next
From: Scott Marlowe
Date:
Subject: Re: High-water Mark for number of sessions/connections reached in Postgres