pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Vikas Sharma <shavikas@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Out of memory: Kill process nnnn (postmaster) score nn or sacrifice child
Date: Tue, 12 Feb 2019 08:39:52 -0800
Message-ID: <a9cd62d2-fd96-86e8-c0ed-3047dfbdb005@aklaver.com> (raw)
In-Reply-To: <CAN6gwKziTexwb4t8eN4SWVL0Jk-DzxJ4txxSVT2gPouALyFeLQ@mail.gmail.com>
References: <CAN6gwKziTexwb4t8eN4SWVL0Jk-DzxJ4txxSVT2gPouALyFeLQ@mail.gmail.com>

On 2/12/19 8:20 AM, Vikas Sharma wrote:
> Hello All,
> 
> I have a 4 node PostgreSQL 9.6 cluster with streaming replication.  we 
> encounter today the Out of Memory  Error on the Master which resulted in 
> All postres  processes restarted and cluster recovered itself. Please 
> let me know the best way to diagnose this issue.

For a start look back further in the Postgres log then the below. What 
is shown below is the effects of the OOM killer. What you need to look 
for is the statement that caused Postgres memory to increase to the 
point that the OOM killer was invoked.

> 
> 
> 
> The error seen in the postgresql log:
> 
> 2019-02-12 10:55:17 GMT LOG:  terminating any other active server processes
> 2019-02-12 10:55:17 GMT WARNING:  terminating connection because of 
> crash of another server process
> 2019-02-12 10:55:17 GMT DETAIL:  The postmaster has commanded this 
> server process to roll back the current transaction and exit, because 
> another server process exited abnormally and possibly corrupted shared 
> memory.
> 2019-02-12 10:55:17 GMT HINT:  In a moment you should be able to 
> reconnect to the database and repeat your command.
> 2019-02-12 10:55:17 GMT WARNING:  terminating connection because of 
> crash of another server process
> 2019-02-12 10:55:17 GMT DETAIL:  The postmaster has commanded this 
> server process to roll back the current transaction and exit, because 
> another server process exited abnormally and possibly corrupted shared 
> memory.
> 2019-02-12 10:55:17 GMT HINT:  In a moment you should be able to 
> reconnect to the database and repeat your command.
> 2019-02-12 10:55:17 GMT WARNING:  terminating connection because of 
> crash of another server process
> -----
> 
> Error from dmesg on linux:
> -----------------------------------
> [4331093.885622] Out of memory: Kill process nnnnn (postmaster) score nn 
> or sacrifice child
> [4331093.890225] Killed process nnnnn (postmaster) total-vm:18905944kB, 
> anon-rss:1747460kB, file-rss:4kB, shmem-rss:838220kB
> 
> Thanks & Best Regards
> Vikas Sharma


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (4+ messages)  latest in thread

Message-ID: <a9cd62d2-fd96-86e8-c0ed-3047dfbdb005@aklaver.com>
Permalink:  ../a9cd62d2-fd96-86e8-c0ed-3047dfbdb005@aklaver.com/
Also on:    postgresql.org/message-id/a9cd62d2-fd96-86e8-c0ed-3047dfbdb005@aklaver.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-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, shavikas@gmail.com
  Subject: Re: Out of memory: Kill process nnnn (postmaster) score nn or sacrifice child
  In-Reply-To: <a9cd62d2-fd96-86e8-c0ed-3047dfbdb005@aklaver.com>
  References: <CAN6gwKziTexwb4t8eN4SWVL0Jk-DzxJ4txxSVT2gPouALyFeLQ@mail.gmail.com> <a9cd62d2-fd96-86e8-c0ed-3047dfbdb005@aklaver.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