Hi,

Sorry for send this email twice but it seems it fits the performance group than 
admin group...

I was reading an article of Gregory Smith 
http://www.westnet.com/~gsmith/content/postgresql/chkp-bgw-83.htm and tried to 
do some analysis on our database.

postgres=#  select * from pg_stat_bgwriter;
-[ RECORD 1 ]------+------------
checkpoints_timed  | 42435
checkpoints_req    | 629448
buffers_checkpoint | 1821978480
buffers_clean      | 117710078
maxwritten_clean   | 23796
buffers_backend    | 1284631340
buffers_alloc      | 32829025268

postgres=# show checkpoint_segments ;
-[ RECORD 1 ]-------+----
checkpoint_segments | 128


postgres=# show checkpoint_timeout ;
-[ RECORD 1 ]------+------
checkpoint_timeout | 10min

bgwriter_delay           bgwriter_lru_maxpages    bgwriter_lru_multiplier
postgres=# show bgwriter_delay;
-[ RECORD 1 ]--+------
bgwriter_delay | 100ms

postgres=# show bgwriter_lru_maxpages;
-[ RECORD 1 ]---------+-----
bgwriter_lru_maxpages | 1000

postgres=# show bgwriter_lru_multiplier;
-[ RECORD 1 ]-----------+--
bgwriter_lru_multiplier | 5

based on one snapshot, below are my thoughts after reading the example reading 
the example Greg used, it might be completely wrong as I'm just starting the 
learning process of checkpoint mechanism in PG.  If anything missing/wrong, 
appreciate if you can help to point out.

# checkpoints_req is much bigger than checkpoints_timed, suggest that I may 
increase checkpoint_segments in our system
#maxwritten_clean is high, suggests increase bgwriter_lru_maxpages
# buffers_backend is much smaller than buffers_alloc, suggests increasing 
bgwriter_lru_maxpages, bgwriter_lru_multiplier, and decreasing bgwriter_delay.


Thanks,
Suya

Reply via email to