How to track number of connections and hosts to Postgres cluster - Mailing list pgsql-performance

From Venkat Balaji
Subject How to track number of connections and hosts to Postgres cluster
Date
Msg-id CAFrxt0gk66pDOuEjB9oQJ=b1VYAeiiNDgEaFz99RhVxrecWsMg@mail.gmail.com
Whole thread Raw
Responses Re: How to track number of connections and hosts to Postgres cluster
List 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

pgsql-performance by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: 8.4 optimization regression?
Next
From: Guillaume Lelarge
Date:
Subject: Re: How to track number of connections and hosts to Postgres cluster