From: Florian Weimer <fweimer@bfk.de>
To: Gregory Stark <stark@enterprisedb.com>
Cc: Richard Yen <dba@richyen.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: postgres memory management issues?
Date: Fri, 07 Sep 2007 11:38:25 +0200
Message-ID: <823axqn7ce.fsf@mid.bfk.de> (raw)
In-Reply-To: <874pi6zurt.fsf@oxford.xeocode.com>
References: <ADDEA1D0-FEEF-4FAD-950E-BC9E49439DF0@richyen.com>
<874pi6zurt.fsf@oxford.xeocode.com>
* Gregory Stark:
> You might also tweak /proc/sys/vm/overcommit_memory but I don't remember what
> the values are, you can search to find them.
"2" is the interesting value, it turns off overcommit.
However, if you're tight on memory, this will only increase your
problems because the system fails sooner. The main difference is that
it's much more deterministic: malloc fails in a predictable manner and
this situation can be handled gracefully (at least by some processes);
no processes are killed.
We use this setting on all of our database server, just in case
someone performs a huge SELECT locally, resulting in a a client
process sucking up all available memory. With vm.overcommit_memory=2,
memory allocation in the client process will fail. Without it,
typically the postgres process feeding it is killed by the kernel.
--
Florian Weimer <fweimer@bfk.de>
BFK edv-consulting GmbH http://www.bfk.de/
Kriegsstraße 100 tel: +49-721-96201-1
D-76133 Karlsruhe fax: +49-721-96201-99
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: fweimer@bfk.de, stark@enterprisedb.com, dba@richyen.com
Subject: Re: postgres memory management issues?
In-Reply-To: <823axqn7ce.fsf@mid.bfk.de>
* 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