How to track number of connections and hosts to Postgres cluster

From: Venkat Balaji <venkat(dot)balaji(at)verse(dot)in>
To: pgsql-performance(at)postgresql(dot)org
Subject: How to track number of connections and hosts to Postgres cluster
Date: 2011-08-24 07:35:45
Message-ID: CAFrxt0gk66pDOuEjB9oQJ=b1VYAeiiNDgEaFz99RhVxrecWsMg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hello Everyone,

I am working on an alert script to track the number of connections with the
host IPs to the Postgres cluster.

1. I need all the host IPs making a connection to Postgres Cluster (even for
a fraction of second).
2. I would also want to track number of IDLE connections, IDLE IN
TRANSACTION connections and length of the connections as well.

I would be making use of pg_stat_activity and also thought of enabling
logging the host ips in the db server log files which seems to be expensive
for me (in terms of IO and logfile size).

Please let me know you if there are any alternatives.

Thanks
Venkat

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Guillaume Lelarge 2011-08-24 07:49:04 Re: How to track number of connections and hosts to Postgres cluster
Previous Message Mark Kirkwood 2011-08-24 05:22:05 Re: 8.4 optimization regression?