Skip site navigation (1) Skip section navigation (2)

Re: postgres memory management issues?

From: Florian Weimer <fweimer(at)bfk(dot)de>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "Richard Yen" <dba(at)richyen(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: postgres memory management issues?
Date: 2007-09-07 09:38:25
Message-ID: 823axqn7ce.fsf@mid.bfk.de (view raw or flat)
Thread:
Lists: pgsql-performance
* 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(at)bfk(dot)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

In response to

pgsql-performance by date

Next:From: Sven GeislerDate: 2007-09-07 09:50:15
Subject: Re: utilising multi-cpu/core machines?
Previous:From: Maila FatticcioniDate: 2007-09-07 09:37:40
Subject: DRBD and Postgres: how to improve the perfomance?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group