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
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster