I was unable to find examples of connection usage graphing and trending. I really wanted this and after a bunch of googling, I just made something up myself. It isn't fancy, but it seems to be working fine for my purposes. This uses cricket to collect, store and graph postgresql connection information. Here's what it currently graphs: Active Connections - COUNT(*) from pg_stat_activity % of Connections Used (SHOW max_connections / COUNT(*) from pg_stat_activity) Non Idle Connections - all the connections that weren't marked as <IDLE> All Idle Connections - pg_stat_activity shows these connections as <IDLE> Long Idle Connections - A connection that has been <IDLE> for more than 5 minutes Resting Connections - connections that have no query information. I suspect these are connections starting up or shutting down, but feel free to clue me in. I thought about graphing the number of SELECTs/INSERTS/UPDATEs/DELETEs currently running. If anyone is interested, I think it would be easy to handle. Hope you find this useful, Tony
Attachment:
cricket-postgresql-connection-monitoring.zip
Description: Zip archive