Re: Setting oom_adj on linux?

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alex Hunsaker <badalex(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Setting oom_adj on linux?
Date: 2010-01-09 22:04:34
Message-ID: 4B48FD72.9030004@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:
> On fre, 2010-01-08 at 11:37 -0500, Tom Lane wrote:
>
>> Alex Hunsaker <badalex(at)gmail(dot)com> writes:
>>
>>> On Fri, Jan 8, 2010 at 07:27, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>>
>>>> Then, somebody who wants the feature would build with, say,
>>>> -DLINUX_OOM_ADJ=0
>>>> or another value if they want that.
>>>>
>>> Here is a stab at that.
>>>
>> Anybody have an objection to this basic approach? I'm in a bit of a
>> hurry to get something like this into the Fedora RPMs, so barring
>> objections I'm going to review this, commit it into HEAD, and then
>> make a back-ported patch I can use with 8.4 in Fedora.
>>
>
> I find this whole approach a bit evil. If word of this gets out, every
> server process on Linux will excuse itself from the OOM killer. And
> then the kernel guys will add another setting to override the process
> preference. It's an arms race, but maybe that's what's needed.
>

The trouble is that the OOM heuristics are pretty bad, and many Linux
hackers aren't interested in improving them. One of the most prominent
told me some years ago "Just turn it off."

And the point of this patch is to allow the postmaster to *remove* OOM
protection from normal postgres backends. We at least would be playing
nice, and not engaging in an arms race.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-01-09 22:07:29 Re: Setting oom_adj on linux?
Previous Message Alex Hunsaker 2010-01-09 21:53:24 Re: Setting oom_adj on linux?