每天晚上我们使用以下方法转储和恢复200 GB的数据库: # Production, PG 9:pg_dump DATNAME | some-irrelevant-pipe# QA, PG 8.3:some-irrelevant-pipe | psql -d DATNAME 我不得不去基于文本的备份,以便从8.3恢复转储
# Production, PG 9: pg_dump DATNAME | some-irrelevant-pipe # QA, PG 8.3: some-irrelevant-pipe | psql -d DATNAME
我不得不去基于文本的备份,以便从8.3恢复转储.
恢复是痛苦和不合理的缓慢.我注意到我的日志充满了这些:
2011-05-22 08:02:47 CDT LOG: checkpoints are occurring too frequently (9 seconds apart) 2011-05-22 08:02:47 CDT HINT: Consider increasing the configuration parameter "checkpoint_segments". 2011-05-22 08:02:54 CDT LOG: checkpoints are occurring too frequently (7 seconds apart) 2011-05-22 08:02:54 CDT HINT: Consider increasing the configuration parameter "checkpoint_segments".
我的问题是:checkpoint_segments的设置是否可能成为瓶颈?我可以调整哪些其他参数来加速这个过程?
那台机器有4 GB RAM. postgresql.conf中其他可能相关的设置是:
shared_buffers = 1000MB work_mem = 200MB maintenance_work_mem = 200MB effective_cache_size = 2000MB # fsync and checkpoint settings are default你读过 this吗?特别参见sec 14.4.9