Dav*_*pin 3 postgresql ubuntu 32-bit ubuntu-12.04
我在 16GB 的 Linode(Ubuntu 12.04 32 位)上运行专用的 PostgreSQL。我试过使用 pgtune,但我会遇到共享内存错误。IE
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
Run Code Online (Sandbox Code Playgroud)
所以我继续并开始调整 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
Run Code Online (Sandbox Code Playgroud)
迁移到 64 位基本上确实使一切正常。SHMAX 被接受(顺便说一下,它以字节为单位)。弄清楚将它设置为什么我只是在盒子上使用了一半的可用 RAM(Ubuntu 上的“free -b”以字节为单位查看内存)。
我基本上采用了 pgtune 的建议,并进行了一些小调整。
apt-get install pgtune
Run Code Online (Sandbox Code Playgroud)
您在具有 16GB RAM 的机器上安装了 32 位操作系统。这行不通。即使 32 位操作系统在技术上可以使用超过 4GB 的 RAM,操作系统上的单个进程也不能超过该边界。重新开始并安装 64 位操作系统,这个问题就会消失(以及您将遇到的所有其他问题)。
| 归档时间: |
|
| 查看次数: |
1265 次 |
| 最近记录: |