每天晚上,我们使用以下命令转储和恢复 200 GB 的数据库:
# Production, PG 9:
pg_dump DATNAME | some-irrelevant-pipe
# QA, PG 8.3:
some-irrelevant-pipe | psql -d DATNAME
为了从 9 到 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