Re: Setting oom_adj on linux? - Mailing list pgsql-hackers

From Alex Hunsaker
Subject Re: Setting oom_adj on linux?
Date
Msg-id 34d269d41001091353hf69576dx16fc256d42b041e2@mail.gmail.com
Whole thread Raw
In response to Re: Setting oom_adj on linux?  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Setting oom_adj on linux?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sat, Jan 9, 2010 at 14:06, Peter Eisentraut <peter_e@gmx.net> wrote:
> I find this whole approach a bit evil.

I would tend to agree but this type of thing has been known since about 2004...

See http://thoughts.j-davis.com/2009/11/29/linux-oom-killer/,
particularly the comment from Greg Smith.

> 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.

Yes, and note debian is already doing that with things like ssh.  Who
knows what else. (Id be curious to know)

Plus maybe it will convince them its time to fix the damn thing.
Although postgres really is kind of special in this regard.  All the
other daemons on my system include X had way lower oom scores.
Alsamixer was 3 times more likely to get killed than the first daemon
with the highest score (hald) while postgres was 55 times more likely.Yes its the kernel being stupid, but its been
knownfor more than 6 
years...

(oom scores: alsamxier: 1497, hald: 487, postgres: 26558)

> It's an arms race, but maybe that's what's needed.

Well *shrug* regardless of what core does... Ill certainly be doing it
on my postgres linux builds :)  Maybe it would convince them more if
we could get distros to accept patches that fix the kernel to do
correct/better shared mem accounting?  May I add good luck? :)


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: win32 socket definition
Next
From: Andrew Dunstan
Date:
Subject: Re: Setting oom_adj on linux?