pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <kgrittn@gmail.com>
To: Scott Marlowe <scott.marlowe@gmail.com>
Cc: Chris Lajoie <chris@etriptrader.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Getting OOM errors from PostgreSQL
Date: Wed, 9 Mar 2016 13:05:18 -0600
Message-ID: <CACjxUsPtYvRv2ish6SCpTsMqBZgU5_XL01JsPTvd++JL2o8hdg@mail.gmail.com> (raw)
In-Reply-To: <CAOR=d=0USzcg+2E1ZSvvijPY2XmSLs+F3U8dELDPyT89no+CkA@mail.gmail.com>
References: <77b989891467460b9e1dede8fedd25f1@etriptrader.com>
	<CACjxUsNYmhsMXfNfEFh7qNTr7fOYPVfxsXLWnQ4Axcjjrqn9OA@mail.gmail.com>
	<56DDC8CB.8050204@etriptrader.com>
	<CAOR=d=0USzcg+2E1ZSvvijPY2XmSLs+F3U8dELDPyT89no+CkA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

On Wed, Mar 9, 2016 at 11:00 AM, Scott Marlowe <scott.marlowe@gmail.com> wrote:

> Note that running with overcommit_memory = 0 if you do start to run
> out of memory, the oom killer will often kill the postmaster. This is
> bad. If this happens make sure to kill all postgres children before
> trying to restart the db, as starting a new postmaster with children
> still running will instantly and permanently corrupt / destroy your
> db.

And even if it kills one of the "normal" backends (perhaps even the
one responsible for some excessive allocations) it causes a PANIC,
which is a crash and restart of the entire database service.  It
will usually do this on a reference to memory which appeared to be
successfully allocated, which can be fairly confusing.  With
overcommit_memory = 2 you usually get just a FATAL error (loss of
connection) on the one connection doing the memory allocation which
puts things over the top, with a dump of space used by memory
contexts in the log.

> The eventual state you want is to be able to run with overcommit = 2
> and settings that prevent out of memory allocations.

Agreed.

> Note too that if you never seem to actually run out of memory, but get
> allocation errors, it can also be a lack of file handles (I think
> that's what caused it in the past for me. Been a while) Point being
> that you can get a failure to allocate memory when there's plenty of
> memory due to other settings on your server.

Yes, I have seen that, too.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (5+ messages)

Message-ID: <CACjxUsPtYvRv2ish6SCpTsMqBZgU5_XL01JsPTvd++JL2o8hdg@mail.gmail.com>
Permalink:  ../CACjxUsPtYvRv2ish6SCpTsMqBZgU5_XL01JsPTvd++JL2o8hdg@mail.gmail.com/
Also on:    postgresql.org/message-id/CACjxUsPtYvRv2ish6SCpTsMqBZgU5_XL01JsPTvd++JL2o8hdg@mail.gmail.com

 · 

reply

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-admin@postgresql.org
  Cc: kgrittn@gmail.com, scott.marlowe@gmail.com, chris@etriptrader.com
  Subject: Re: Getting OOM errors from PostgreSQL
  In-Reply-To: <CACjxUsPtYvRv2ish6SCpTsMqBZgU5_XL01JsPTvd++JL2o8hdg@mail.gmail.com>
  References: <77b989891467460b9e1dede8fedd25f1@etriptrader.com> <CACjxUsNYmhsMXfNfEFh7qNTr7fOYPVfxsXLWnQ4Axcjjrqn9OA@mail.gmail.com> <56DDC8CB.8050204@etriptrader.com> <CAOR=d=0USzcg+2E1ZSvvijPY2XmSLs+F3U8dELDPyT89no+CkA@mail.gmail.com> <CACjxUsPtYvRv2ish6SCpTsMqBZgU5_XL01JsPTvd++JL2o8hdg@mail.gmail.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