2012-09-27 17 views
11

こんにちは!postgresql共有メモリの設定

我々は現在、共有メモリに関連する以下のパラメータを有する:

Postgresの

shared_buffers = 7GB 
max_connections = 1 500 
max_locks_per_transaction = 1 024 
max_prepared_transactions = 0 (not set) 

システム

SHMALL = 2 097 152 
SHMMAX = 17 670 512 640 
SHMMNI = 4096 

RAMの量は、24 693 176K

です

我々はこれを行うことを試みたとき、我々はエラー

[1-1] FATAL: could not create shared memory segment: No space left on device 
[2-1] DETAIL: Failed system call was shmget(key=5432001, size=8964661248, 03600) 
[3-1] HINT: This error does *not* mean that you have run out of disk space. 
It occurs either if all available shared memory IDs have been taken, in which 
case you need to raise the SHMMNI parameter in your kernel, or because the 
system's overall limit for shared memory has been reached. If you cannot 
increase the shared memory limit, reduce PostgreSQL's shared memory request 
(currently 8964661248 bytes), perhaps by reducing shared_buffers or 
max_connections. 
The PostgreSQL documentation contains more information about shared memory 
configuration. 

を得たヒントがSHMMNIカーネルパラメータの値を大きくすることを提案しているが、私はどのようにわからないんだけど 000 3にMAX_CONNECTIONSを増やす必要があります多くのことを追加する:)また、私はこれらのすべてのパラメータが何らかの形で相関していると考えているので、それに応じて他のパラメータを変更する必要がありますか?事前に

おかげで、

アレクサンダー

答えて

17

SHMMNIを増やすと、それがここで問題とヒントの第二部ですが、助けにはなりません。

システムのページサイズは、シェルコマンドgetconf PAGE_SIZEで取得してください。
通常は4096です。これにはSHMALLを掛けます。

あなたのケースでは、2097152 * 4096 = 8589934592でなければなりません。これはまさに8Gbです。 これは現在の最大共有メモリで、SHMMNIとは独立しています。

PostgreSQLのエラーメッセージは、それ以上のものが必要であることを示しています。

結論:増加SHMALL

+2

お返事いただきありがとうございます! – shutyaev

+1

注:docs(postgresql.org/docs/9.0/static/kernel-resources.html)のlinuxセクションに従って、SHMALLの値はPAGE_SIZEをSHMAXで割った値にする必要があります。 –