On Mon, Dec 20, 2010 at 6:41 AM, Benoit Clennett-Sirois
<benoit@lesite.ca> wrote:
> Hi,
>
> We have a front-end server taking care of Nginx, memcached and
> Postgresql. Last night the postgres daemon crashed (traffic was very
> low at that time) with the following error:
>
> 2010-12-20 03:34:30 EST DETAIL: Failed system call was
> shmget(key=5432001, size=1124474880, 03600).
> 2010-12-20 03:34:30 EST 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 1124474880
> bytes), reduce PostgreSQL's shared_buffers parameter (currently
> 131072) and/or its max_connections parameter (currently 963).
Are you sure this is the crash and not the symptom of a restart issue
or something?
I'd look more carefully through the logs for the PANIC that a crash
should cause. I'm guessing you got killed by the OOM killer. 4 Gigs
is pitiful for a multi-purpose db / web server, my son's laptop has 8
gigs. What do you have work_mem set to? A high setting there can be
quickly fatal since it's per-sort, not total.
Generally shared_buffers ~1Gig on a 4Gig machine would be reasonable
if it was just a db server. If it's shared with other stuff, drop it
down to the 100Meg range.