簡體   English   中英

postgresql共享內存設置

[英]postgresql shared memory settings

大家好!

我們目前有以下與共享內存相關的參數:

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

我們需要將max_connections增加到3 000.當我們嘗試這樣做時,我們遇到了錯誤

[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內核參數,但我不確定要添加多少:)另外,我相信所有這些參數都以某種方式相關,所以我們是否需要相應地更改任何其他參數?

提前致謝,

亞歷山大

增加SHMMNI無濟於事,這是暗示的第二部分。

使用shell命令getconf PAGE_SIZE獲取系統的頁面大小。
通常它是4096.乘以SHMALL

在你的情況下應該是2097152 * 4096 = 8589934592,這正是8Gb。 這是您當前的最大共享內存,與SHMMNI無關。

PostgreSQL錯誤消息表明它需要更多。

結論:增加SHMALL

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM