pg_statsinfo monitors an instance of a PostgreSQL server and gathers the statistics and activities of a server as snapshots. The snapshots will be stored in the same or another repository database.
It also parses PostgreSQL's CSV server log filesm and extracts performance logs from them. Error messages are routed into textlog and syslog according to the message levels.
pg_statsinfo can be easily installed and maintained because it starts or stops automatically when PostgreSQL server starts or stops.
Statistics counters from pg_statsinfo can be displayed with pg_reporter as graphicsl reports.
pg_statsinfo works as the following image. It monitors one PostgreSQL instance (server).
Two connections required if monitored instance and repository are on the same server.
If this isn't the case, 1 connection for the monitored instance / 1 connections for repository.
Here are some key features of "pg_statsinfo":
· Snapshots are gathered periodically (default: every 5 minites) or by manual.
· An event handler function is called after every snapshots taken. The function can be defined by users. A new snapshot can be compared with previous snapshots and raise alert messages in the function.
A snapshot holds the following statistics information:
· All of the information collected by the statistics collector. For example, numbers of INSERT/UPDATE/DELETE and buffer access counters.
· Disk usages of each tablespace, pg_xlog, and archive log directory.
· Long transactions and their query strings.
· Process status in running, waiting for locks, idle in transaction, and idle.
· Duration and buffer accesses in checkpoints and autovacuums.
· SQLs and functions that take long time.
· PostgreSQL configuration parameters.
Server Log Filter:
· Split server log lines according to the message levels. You can set different message threshold for csvlog, textlog, and syslog.
· Fix filename of the latest textlog. The default is $PGDATA/pg_log/postgresql.log. You can always read the latestlog in the same filename and setup of log monitoring tools would be easier.
· Set arbitrary access permission for each textlog files. You can control the default permission not only 600.
· Start or stop with PostgreSQL. pg_statsinfo daemon can automatically start or stop with PostgreSQL instance. No additional operations are required.
· Reload parameters online. Configuration parameters like snapshot interval can be modified with "pg_ctl reload".
· PostgreSQL 8.3 or higher
· OS: RHEL 5.3, CentOS 5.3, Windows XP
· pg_statsinfo doesn't delete old snapshots, so the user has to delete them manually.
· pg_statsinfo doesn't delete old server log files, so the user has to delete them manually.
What's New in This Release: [ read full changelog ]
· Added create reports command for statistics database performance, decrease snapshot data size, and fix some bugs.