[Linux] 共有メモリ設定(shmmax & shmall) PostgreSQL8.3.1編

このエントリーをはてなブックマークに追加
はてなブックマーク - [Linux] 共有メモリ設定(shmmax & shmall) PostgreSQL8.3.1編
Bookmark this on Yahoo Bookmark
Bookmark this on Livedoor Clip

PostgreSQLでは共有メモリと呼ばれるものを使用しています。
デフォルトの設定で大概行けるのですが、制限に引っかかる可能性がある為、
しっかり計算して設定しておく方が無難です。

■必要な共有メモリ

設定値

計算式

max_connections 1800 + 270 × max_locks_per_transaction
autocacuum_max_works 1800 + 270 × max_locks_per_transaction
max_prepared_transactions 770 + 270 × max_locks_per_transaction
shared_buffers 8KBごとに8400バイト
wal_buffers 8KBごとに8200バイト
max_fsm_relations 70
max_fsm_pages 6
固定サイズ 770KB

設定はrootで行って下さい。
【設定例】

#expr 100 '*' 1024 '*' 1024 > /proc/sys/kernel/shmmax
#expr 100 '*' 1024 '*' 1024 > /proc/sys/kernel/shmall
Related Posts

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <img localsrc="" alt=""> <pre lang="" line="" escaped="" highlight="">