Thanks for these workarounds I have something similar implemented. It would've been nice to have Postgres maintain the high-water mark inside the database in a pg view such as pg_stat_database. This is useful from a capacity perspective where that can be monitored to alert DBAs when a threshold is reached. Other DB engines has such feature built in such as Oracle. Perhaps something to be on Postgres TO DO list soon :) Regards, Husam -----Original Message----- From: pgsql-admin-owner@xxxxxxxxxxxxxx [mailto:pgsql-admin-owner@xxxxxxxxxxxxxx] On Behalf Of Alvaro Herrera Sent: Monday, August 09, 2010 3:39 PM To: Scott Marlowe Cc: Tomeh, Husam; pgsql-admin@xxxxxxxxxxxxxx Subject: Re: High-water Mark for number of sessions/connections reached in Postgres Excerpts from Scott Marlowe's message of lun ago 09 18:29:58 -0400 2010: > If you want a date stamp, you can change the ps ax stuff to look like this: > > date +"%Y-%m-%d %H:%M:%S"|tr "\n" ":";ps ax|grep postgres:|grep -v grep|wc -l FWIW the "grep" business is best solved by ps itself, something like ps ax -C postgres date +"%Y-%m-%d %H:%M:%S"|tr "\n" ":";ps ax -C postgres|wc -l -- Álvaro Herrera <alvherre@xxxxxxxxxxxxxxxxx> The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support -- Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin ****************************************************************************************** This message may contain confidential or proprietary information intended only for the use of the addressee(s) named above or may contain information that is legally privileged. If you are not the intended addressee, or the person responsible for delivering it to the intended addressee, you are hereby notified that reading, disseminating, distributing or copying this message is strictly prohibited. If you have received this message by mistake, please immediately notify us by replying to the message and delete the original message and any copies immediately thereafter. Thank you. ****************************************************************************************** CLLD -- Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin