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位操作系统,这个问题将消失(以及你将遇到的所有其他问题).

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...