Better Connection Statistics

From: Shaun Thomas <sthomas(at)optionshouse(dot)com>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Better Connection Statistics
Date: 2014-02-07 15:00:38
Message-ID: 0683F5F5A5C7FE419A752A034B4A0B97976F8E97@sswchi5pmbx2.peak6.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice

Hi everyone,

So, I haven't ever heard of this, but I could be missing something. Is there a module or extension for PostgreSQL keep connection statistics? I don't mean what's in pg_stat_activity, but cumulative. And not like what's in pg_stat_statements, but about the connections themselves. Nor even pg_stat_database, since that's only granular at the database level.

For instance, I want the number of transactions a specific connection has submitted. The number of queries. Total amount of CPU time consumed, etc. So far as I know, there is no module, statistic, or view that provides any of this. It occurred to me after one of our NOC guys asked us if a certain machine was spamming us with queries, and I realized I didn't know, and had no way of finding out. The best I can do is see if any are currently, this very second, executing something. If the connection happens to be between transactions when I poll pg_stat_statements, I get nothing.

I know pg_pool and pg_bouncer provide info like this, but we don't use those. Is there anything internal to PG that can... eventually get it?

--
Shaun Thomas
OptionsHouse | 141 W. Jackson Blvd | Suite 500 | Chicago IL, 60604
312-676-8870
sthomas(at)optionshouse(dot)com

______________________________________________

See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2014-02-07 16:27:37 Re: password-less access, without using pg_hba
Previous Message Albe Laurenz 2014-02-07 09:12:10 Re: client encoding that psql command sets

Browse pgsql-novice by date

  From Date Subject
Next Message rob stone 2014-02-07 18:02:27 Re: Better Connection Statistics
Previous Message David Johnston 2014-02-06 18:53:14 Re: understand basics - multiple cars in a database - selection of one