微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

我们需要将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内核参数,但我不知道添加多少:)另外,我相信所有这些参数都以某种方式关联,所以我们需要相应地更改任何其他参数吗?

提前致谢,

亚历山大

增加SHMMNI将不会有帮助,这是提醒的第二部分.

使用shell命令getconf PAGE_SIZE获取系统的页面大小.
通常是4096.乘以SHMALL.

在你的情况下,应该是2097152 * 4096 = 8589934592,这正是8Gb.
这是您目前最大的共享内存,独立于SHMMNI.

Postgresql错误消息表明它需要更多的功能.

结论:增加SHMALL.

原文地址:https://www.jb51.cc/postgresql/192198.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐