postgresql - What's the unit of buffers_checkpoint in pg_stat_bgwriter table? -


i'm using postgresql-9.1.6 , trying build monitoring application postgresql server.

i'm planning select physical , logical i/o stat pg_stat_* information tables.

according manual unit of fields in pg_stat_database block means size of 8kb.

postgres=# select * pg_stat_database datname='postgres';     -[ record 3 ]-+------------------------------ datid         | 12780 datname       | postgres numbackends   | 2 xact_commit   | 974 xact_rollback | 57 blks_read     | 210769 blks_hit      | 18664177 tup_returned  | 16074339 tup_fetched   | 35121 tup_inserted  | 18182015 tup_updated   | 572 tup_deleted   | 3075 conflicts     | 0 

i figure out size of physical read usging blks_read * 8kb. however, there no comments on unit of stats in pg_stat_bgwriter.

postgres=# select * pg_stat_bgwriter; -[ record 1 ]---------+------------------------------ checkpoints_timed     | 276 checkpoints_req       | 8 buffers_checkpoint    | 94956 buffers_clean         | 0 maxwritten_clean      | 0 buffers_backend       | 82618 buffers_backend_fsync | 0 buffers_alloc         | 174760 stats_reset           | 2013-07-15 22:27:05.503125+09 

how can calculate size of physical write through buffers_checkpoint?

any advice wold appreciated.

taken de facto performance handbook "postgresql 9.0 high performance" greg smith, in chapter on database activity , statistics:

  • what percentage of time checkpoints being requested based on activity instead of time passing?
  • how data average checkpoint write?
  • what percentage of data being written out happens checkpoints , backends, respectively?
select     (100 * checkpoints_req) /         (checkpoints_timed + checkpoints_req) checkpoints_req_pct,     pg_size_pretty(buffers_checkpoint * block_size /          (checkpoints_timed + checkpoints_req)) avg_checkpoint_write,     pg_size_pretty(block_size *         (buffers_checkpoint + buffers_clean + buffers_backend)) total_written,     100 * buffers_checkpoint /         (buffers_checkpoint + buffers_clean + buffers_backend) checkpoint_write_pct,     100 * buffers_backend /         (buffers_checkpoint + buffers_clean + buffers_backend) backend_write_pct,     * pg_stat_bgwriter, (select cast(current_setting('block_size') integer) block_size) bs; 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -