Alexander Farber
2011-Oct-04 15:45 UTC
[CentOS] CentOS 6: Increase shared memory limits permanently
Hello again, on CentOS 6 / 64 bit what is please the best way to permanently increase the shared memory? I'd like to give shared_buffers = 4096MB to PostgreSQL 8.4 on my machine with 16 GB RAM, but I currently only have: # sysctl -A|grep shm kernel.shmmax = 33554432 kernel.shmall = 2097152 kernel.shmmni = 4096 and this produces the error in /var/lib/pgsql/pgstartup.log: FATAL: could not create shared memory segment: Invalid argument DETAIL: Failed system call was shmget(key=5432001, size=4399202304, 03600). 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 4399202304 bytes), reduce PostgreSQL's shared_buffers parameter (currently 524288) and/or its max_connections parameter (currently 103). 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. And I wonder if I should set shmmax or shmall and also if these 2 limits are total for all machine processes or per process? (i.e. should I allow a bit more for processes besides PostgreSQL)? Thank you Alex
John R Pierce
2011-Oct-04 15:53 UTC
[CentOS] CentOS 6: Increase shared memory limits permanently
On 10/04/11 8:45 AM, Alexander Farber wrote:> on CentOS 6 / 64 bit what is please the best way > to permanently increase the shared memory?/etc/sysctl.conf -- john r pierce N 37, W 122 santa cruz ca mid-left coast
m.roth at 5-cent.us
2011-Oct-04 17:14 UTC
[CentOS] CentOS 6: Increase shared memory limits permanently
Alexander Farber wrote:> Hello again, > > on CentOS 6 / 64 bit what is please the best way > to permanently increase the shared memory? > > I'd like to give shared_buffers = 4096MB > to PostgreSQL 8.4 on my machine with > 16 GB RAM, but I currently only have: > > # sysctl -A|grep shm > kernel.shmmax = 33554432 > kernel.shmall = 2097152 > kernel.shmmni = 4096 > > and this produces the error in > /var/lib/pgsql/pgstartup.log:<snip>> And I wonder if I should set shmmaxYes. As a point of information, you do this for Oracle as well. mark