Setting oom_adj on linux?

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Setting oom_adj on linux?
Date: 2010-01-04 15:39:14
Message-ID: 9837222c1001040739l79fa0978ib1816a112798008e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I realize this is a very platform-specific thing, but should we
consider setting the value of /proc/<pid>/oom_adj when running on
linux? See:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/proc.txt;h=220cc6376ef80e0c9bcfec162d45552e729cdf5a;hb=45d28b097280a78893ce25a5d0db41e6a2717853

section 3.1.

To get the best benefit, I think it needs to be done in cooperation
between the startup scripts and PostgreSQL. We'd want -17 ("never oom
kill") on the postmaster, but some different value on regular backends
(since if it has to kill someone, it's better to pick a regular
backend so we can do a controlled restart). Only root can drop the
value, so the startup script needs to be part of it. But if we then
want to increase it for sub-processes, that'd require something in the
backend itself...

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2010-01-04 15:42:32 Re: patch - per-tablespace random_page_cost/seq_page_cost
Previous Message Robert Haas 2010-01-04 15:31:47 Re: New VACUUM FULL