PostgreSQL oom_adj postmaster process to -17

From: Radovan Jablonovsky <radovan(dot)jablonovsky(at)replicon(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: PostgreSQL oom_adj postmaster process to -17
Date: 2012-07-24 19:18:41
Message-ID: CAJYcdTvw-Xk9oi0Hzb9w3wZYfB6LJ5KMCQW0uR7o0HdFATC4tQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello,

We are running PostgreSQL version 9.1.1 with 32GB of RAM, 32GB of SWAP and
during high load we could reach (swap + RAM) memory limit. In this case
OOM-killer kills postgresql process(es). (Out of Memory: Killed process
12345 (postgres)). As admin I would like to exclude postgresql system
processes from being chosen by OOM-killer. Based on the PostgreSQL
documentation it could be done by properly setting vm.overcommit_memory=2,
vm.overcommit_ratio=(probably between 50 and 90) and set the
process-specific oom_adj value for the postmaster process to -17, thereby
guaranteeing it will not be targeted by the OOM killer. The PostgreSQL
should build with -DLINUX_OOM_ADJ=0 added to CPPFLAGS to have child
processes oom_adj equal to 0.

1) Will this setting means other system processes (logger process, writer
process, stats collector process, wal receiver process, etc..), which are
children of postmaster process, will be running with oom_adj set to 0 too?
2) Should the proper Postgresql compilation configuration be: ./configure
... CPPFLAGS="-DLINUX_OOM_ADJ=0" ...
3) Does somebody has experience with this solution for CentOS
kernel 2.6.18-308.el5 x86_64?

Sincerely,

*Radovan Jablonovsky*
**

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jesper Krogh 2012-07-24 19:58:21 Tuning checkpoint_segments and checkpoint_timeout.
Previous Message Joshua D. Drake 2012-07-24 17:41:41 Re: db size growing out of control when using clustered Jackrabbit