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

ubuntu – 在16GB Linode VPS上调优Postgresql

我在16GB Linode(Ubuntu 12.04 32bit)上运行专用的Postgresql.我尝试过使用pgtune,但是我会遇到共享内存错误.即
The Postgresql server Failed to start. Please check the log output:
2014-02-10 08:32:39 EST FATAL:  Could not create shared memory segment: Invalid argument
2014-02-10 08:32:39 EST DETAIL:  Failed system call was shmget(key=5432001,size=4107419648,03600).
2014-02-10 08:32:39 EST HINT:  This error usually means that Postgresql's request for a shared memory segment exceeded your kernel's SHMMAX parameter.  You can either reduce the request size or reconfigure the kernel with larger SHMMAX.  To reduce the request size (currently 4107419648 bytes),reduce Postgresql's shared memory usage,perhaps by reducing shared_buffers or max_connections.
    If the request size is already small,it's possible that it is less than your kernel's SHMMIN parameter,in which case raising the request size or reconfiguring SHMMIN is called for.
    The Postgresql documentation contains more information about shared memory configuration

所以我继续开始调整SHMAX,但我真的不确定应该将它设置为什么.我希望pgtune会让我知道,或者我可以找到一些关于这个的文件@ linode.我假设这个值是以字节为单位的?我已经读过它应该是总内存的1/4到1/2(所以4或8 GB),但是当你在32位时它不应该超过4GB.

任何建议?您会建议将SHMAX设置为什么?为什么?我应该放弃pgtune,还是通过最大内存参数?

谢谢!

VPS内存详细信息:

total       used       free     shared    buffers     cached
Mem:      16617352     334320   16283032          0      18132     208400
-/+ buffers/cache:     107788   16509564
Swap:       524284          0     524284

– 更新 –

迁移到64位基本上可以使一切正常. SHMAX被接受了(顺便说一下,它是以字节为单位).找出要设置它的内容我只需要将一半可用内存放在盒子上(Ubuntu上的“free -b”以字节为单位查看内存).

我基本上用pgtune推荐了其余的一些小调整.

apt-get install pgtune
您在具有16GB RAM的计算机上安装了32位操作系统.这不会起作用.即使32位操作系统在技术上可以使用超过4GB的RAM,操作系统上的任何单个进程都不能超过该边界.重新开始并安装一个64位操作系统,这个问题将消失(以及你将遇到的所有其他问题).

原文地址:https://www.jb51.cc/ubuntu/347701.html

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

相关推荐