From: reina@nsi.edu
To: pgsql-admin@postgresql.org
Subject: Re: Finding number of current connections
Date: 9 Aug 2001 09:37:53 -0700
Message-ID: <f40d3195.0108090837.4d317746@posting.google.com> (raw)
References: <NBBBLBKDJMGDNPMDGAABAEBKBBAB.tauren@servlets.net>
tauren@servlets.net ("Tauren Mills") wrote in message news:<NBBBLBKDJMGDNPMDGAABAEBKBBAB.tauren@servlets.net>...
> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: reina@nsi.edu
Subject: Re: Finding number of current connections
In-Reply-To: <f40d3195.0108090837.4d317746@posting.google.com>
References: <NBBBLBKDJMGDNPMDGAABAEBKBBAB.tauren@servlets.net> <f40d3195.0108090837.4d317746@posting.google.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox