Re: [HACKERS] keeping track of connections - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] keeping track of connections
Date
Msg-id 199806031258.IAA06017@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] keeping track of connections  (Brett McCormick <brett@work.chicken.org>)
List pgsql-hackers
>
> On Wed, 3 June 1998, at 01:05:17, David Gould wrote:
>
> > I am curious, what is it you are trying to accomplish with this? Are you
> > trying to build a persistant log that you can query later for billing
> > or load management/capacity planning information? Are you trying to monitor
> > login attempts for security auditing? Are you trying to catch logins in
> > real time for some sort of middleware integration?
>
> The problem is that when I do a process listing for the postgres user,
> I see many backends.  There's no (convenient) way to see what those
> backends are doing, what db they're connected to or the remote
> host/postgres user.
>
> My required functionality is this: a list of all backends and
> connection details.  IP, queries issued, listens/notifications
> requested/served, bytes transfered, postgres user, db, current query,
> client version, etcetcetc.

That's a lot of info.  One solution for database and username would be
to modify argv[1] and argv[2] for the postgres backend so it shows this
information on the ps command line.  As long as these args are already
used as part of startup ( and they are when started under the
postmaster), we could set argv to whatever values we are interested in,
and clear the rest of them so the output would look nice.

This would be easy to do, and I would be glad to do it.


> What problem am I trying to solve?  It is purely a desire for this
> information.  I also feel it will help be debug problems.  It would be
> nice to track down my clients that are now failing because of password
> authentication, but I do admit that this would not help much.

I think you need a log entry for that, and it would be a good idea.



--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] keeping track of connections
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] dump/reload