Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Mar 2006 16:17:31 -0500
From:      Charles Swiger <cswiger@mac.com>
To:        Miguel <mmiranda@123.com.sv>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: setting shmmax for postgres
Message-ID:  <2F7CD998-9048-4299-BEED-9CA475787B2B@mac.com>
In-Reply-To: <441F125F.8030101@123.com.sv>
References:  <441F125F.8030101@123.com.sv>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mar 20, 2006, at 3:36 PM, Miguel wrote:
> shiva2# sysctl -a kern.ipc.shmmax
> kern.ipc.shmmax: 2147483647
>
> but postgres always fails with this error
>
> The PostgreSQL documentation contains more information about shared  
> memory configuration.
> FATAL:  could not create shared memory segment: Cannot allocate memory
> DETAIL:  Failed system call was shmget(key=5432001,  
> size=1149067264, 03600).
> HINT:  This error usually means that PostgreSQL's request for a  
> shared memory segment exceeded available memory or swap space. To  
> reduce the request size (currently 1149067264 bytes), reduce  
> PostgreSQL's shared_buffers parameter (currently 137626) and/or its  
> max_connections parameter (currently 200).

Just how much RAM do you have in the machine?  I don't think you can  
allocate more than 256MB or so to SysV shared memory without tuning  
the number of KVA pages being allocated to the kernel...?  Maybe it  
depends on whether the SysV shmem segments are wired down by default  
or not, I think there's a sysctl which controls that.

You should revert Postgres back to a more reasonable default shared  
region size for now and rebuild the kernel to increase these  
parameters if you actually have the RAM and the need to do so.

--
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2F7CD998-9048-4299-BEED-9CA475787B2B>