Search Postgresql Archives

Monitoring PostgreSQL connections using cricket and pg_stat_activity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux