From: Richard Yen <dba@richyen.com>
To: pgsql-performance@postgresql.org
Subject: postgres memory management issues?
Date: Thu, 6 Sep 2007 09:06:53 -0700
Message-ID: <ADDEA1D0-FEEF-4FAD-950E-BC9E49439DF0@richyen.com> (raw)
Hi All,
I've recently run into problems with my kernel complaining that I ran
out of memory, thus killing off postgres and bringing my app to a
grinding halt.
I'm on a 32-bit architecture with 16GB of RAM, under Gentoo Linux.
Naturally, I have to set my shmmax to 2GB because the kernel can't
support more (well, I could set it to 3GB, but I use 2GB for safety).
Shared_buffers is 200000 and max_connections is 600.
Here is a snippet of my log output (I can give more if necessary):
Sep 5 18:38:57 tii-db2.oaktown.iparadigms.com Out of Memory: Kill
process 11696 (postgres) score 1181671 and children.
Sep 5 18:38:57 tii-db2.oaktown.iparadigms.com Out of Memory: Kill
process 11696 (postgres) score 1181671 and children.
Sep 5 18:38:57 tii-db2.oaktown.iparadigms.com Out of memory: Killed
process 11704 (postgres).
Sep 5 18:38:57 tii-db2.oaktown.iparadigms.com Out of memory: Killed
process 11704 (postgres).
[...]
Sep 5 18:38:57 tii-db2.oaktown.iparadigms.com postgres[11696]: [6-1]
2007-09-05 18:38:57.626 PDT [user=,db= PID:11696 XID:]LOG:
background writer process (PID 11704) was terminated by signal 9
Sep 5 18:38:57 tii-db2.oaktown.iparadigms.com postgres[11696]: [7-1]
2007-09-05 18:38:57.626 PDT [user=,db= PID:11696 XID:]LOG:
terminating any other active server processes
My understanding is that if any one postgres process's memory usage,
plus the shared memory, exceeds the kernel limit of 4GB, then the
kernel will kill the process off. Is this true? If so, would
postgres have some prevention mechanism that would keep a particular
process from getting too big? (Maybe I'm being too idealistic, or I
just simply don't understand how postgres works under the hood)
--Richard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: dba@richyen.com
Subject: Re: postgres memory management issues?
In-Reply-To: <ADDEA1D0-FEEF-4FAD-950E-BC9E49439DF0@richyen.com>
References: <ADDEA1D0-FEEF-4FAD-950E-BC9E49439DF0@richyen.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox