12

こんにちは、みんな!

現在、共有メモリに関連する次のパラメータがあります。

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の容量は24693176kです

max_connectionsを3000に増やす必要があります。これを実行しようとすると、エラーが発生しました。

[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カーネルパラメータを増やすことを提案していますが、どれだけ追加するかはわかりません:)また、これらのパラメータはすべて何らかの形で相関していると思います。それに応じて他のパラメータを変更する必要がありますか?

前もって感謝します、

アレクサンダー

4

1 に答える 1

18

ここSHMMNIで重要なのは、ヒントの 2 番目の部分です。

シェル コマンドでシステムのページ サイズを取得しますgetconf PAGE_SIZE
通常は 4096SHMALLです。

あなたの場合、それは 2097152 * 4096 = 8589934592 で、正確に 8Gb です。これは、 とは関係なく、現在の最大共有メモリですSHMMNI

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

結論:増やすSHMALL

于 2012-09-27T10:47:03.180 に答える