Re: Setting oom_adj on linux?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Alex Hunsaker <badalex(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Setting oom_adj on linux?
Date: 2010-01-08 17:24:18
Message-ID: 8716.1262971458@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stephen Frost <sfrost(at)snowman(dot)net> writes:
> * Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
>> I don't want to go to the trouble of creating (and documenting) a
>> configure option for this. Much less a GUC ;-)

> Requiring a custom build to disable it would be horrible, in my view.
> Or, at best, just means that the packagers won't enable it, which
> obviously would be less than ideal.

I'm a packager, and I think that this approach is perfectly fine.
The place where the rubber meets the road is in the init script,
which is the packager's responsibility. If the packager is going
to provide an init script that sets oom_adj in the first place,
he can turn on the compensation code inside the binary. If not,
the compensation code has no purpose anyhow. There are no moving
parts in this as far as the end user is concerned.

> Sorry if it's a pain, but I think it needs to either be configurable or
> not done. As I said before, it definitely needs to handle failure
> gracefully,

We just ignore any error from the attempt to write to /proc.

> but I worry that even that won't be sufficient in some
> cases. Just thinking about how we run PG under VServers and Linux
> Containers and whatnot,

I think you are missing the point that the code won't even be compiled
except on platforms where the packager has determined that it's sensible
to have it.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2010-01-08 17:24:39 Re: Setting oom_adj on linux?
Previous Message Dave Page 2010-01-08 17:24:11 Re: RFC: PostgreSQL Add-On Network