PostgreStats Frequently Asked Questions
How are statistics logged and updated?PostgreStats Enterprise statistics are logged VIA a scheduled cron-job where the main ps_cron.php file is executed at any interval you choose. Statistics are pulled directly from PostgreSQL's Statistics Collector and stored inside the main PostgreStats database. PostgreStats does not require a reset of the Collector's statistics at any time, for example with pg_stat_reset();
What statistics are logged in PostgreStats?From PostgreSQL's stat collector, the primary statistics gathered for viewing in PostgreStats are:
- Commits (recorded in pg_stat_database as field: xact_commit)
- Roll Backs (recorded in pg_stat_database as field: xact_rollback)
- Block Reads (recorded in pg_stat_database as field: blks_read)
- Buffer Hits (recorded in pg_stat_database as field: blks_hit)
- User Table Inserts (recorded in pg_stat_user_tables as field: n_tup_ins)
- User Table Updates (recorded in pg_stat_user_tables as field: n_tup_upd)
- User Table Deletes (recorded in pg_stat_user_tables as field: n_tup_del)
- Sequence Scans (recorded in pg_stat_user_tables as field: seq_scan)
- Sequence Scans Rows Used (recorded in pg_stat_user_tables as field: seq_tup_read)
- Index Scans (recorded in pg_stat_user_tables as field: idx_scan)
- Index Scans Rows Used (recorded in pg_stat_user_tables as field: idx_tup_fetch)
How often should I update my statistics?Each time ps_cron.php is executed, stats for your servers and databases are recorded. Your specific needs will determine how often you execute this file and collect statistics but a good starting point might be once an hour. The number of servers and databases collecting stats might also affect how often you collect. Regardless of your cron schedule, ps_cron.php must be executed at least once per day and as close (but prior to) midnight as possible.
Will PostgreStats run on a non-Linux server?PostgreStats was developed and tested under a RedHat Linux operating system. While it will most likely run unmodified successfully on many other flavors of Linux and Unix-based systems, they are not officially supported.
How can I secure PostgreStats Enterprise?There are several things you can do to secure your implementation. We recommend first, once your stats are set up and collecting successfully, to chmod / chown the ps_cron.php script as being owned by root and executing the cron-job as root only. Secondly, because PostgreStats has a full-featured online GUI, we strongly recommend you only view statistics and modify your data in an SSL environment where any data to and from the site and servers will be encrypted.