Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f79H2UP61745 for ; Thu, 9 Aug 2001 13:02:30 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f79Gbtw42096 for pgsql-admin@postgresql.org; Thu, 9 Aug 2001 12:37:55 -0400 (EDT) (envelope-from news) From: reina@nsi.edu (Tony Reina) X-Newsgroups: comp.databases.postgresql.admin Subject: Re: Finding number of current connections Date: 9 Aug 2001 09:37:53 -0700 Organization: http://groups.google.com/ Lines: 27 Message-ID: References: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-admin@postgresql.org X-Archive-Number: 200108/37 X-Sequence-Number: 1968 tauren@servlets.net ("Tauren Mills") wrote in message news:... > I need to find a way to determine how many concurrent connections are being > made to the database server at any given time. You may find what you are looking for with Bruce Momjian's pgmonitor tool. http://greatbridge.org/project/pgmonitor/projdisplay.php Alternatively, you could just use a simple shell script. All of the Postgres connections are separate jobs with the identifier "postgres:" at the begining. So you could simply do: ps ax | grep postgres: on a RH Linux machine. With some sed/awk commands, you could sort the job information even finer. For example, to find out which users are logged onto the database at any given time: ps ax | grep postgres: | awk '{print $6 | "sort" } ' | uniq I'm sure if you fooled around with this, you could come up with something tailored to your needs in no time. -Tony