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

From Tom Lane
Subject Re: Setting oom_adj on linux?
Date
Msg-id 8716.1262971458@sss.pgh.pa.us
Whole thread Raw
In response to Re: Setting oom_adj on linux?  (Stephen Frost <sfrost@snowman.net>)
Responses Re: Setting oom_adj on linux?
List pgsql-hackers
Stephen Frost <sfrost@snowman.net> writes:
> * Tom Lane (tgl@sss.pgh.pa.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


pgsql-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: RFC: PostgreSQL Add-On Network
Next
From: Stephen Frost
Date:
Subject: Re: Setting oom_adj on linux?