Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WuOYq-00039e-Rp for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Jun 2014 16:06:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WuOYq-0007oO-9G for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Jun 2014 16:06:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WuOYo-0007lf-98 for pgsql-hackers@postgresql.org; Tue, 10 Jun 2014 16:06:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WuOYk-0005dd-Ko for pgsql-hackers@postgresql.org; Tue, 10 Jun 2014 16:06:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s5AG5uJK031653; Tue, 10 Jun 2014 12:05:56 -0400 From: Tom Lane To: Gurjeet Singh cc: Andres Freund , Peter Eisentraut , PGSQL Hackers Subject: Re: /proc/self/oom_adj is deprecated in newer Linux kernels In-reply-to: References: <29121.1316185073@sss.pgh.pa.us> <1316355543.12186.9.camel@vanquo.pezone.net> <15953.1316362868@sss.pgh.pa.us> <1316420754.14001.3.camel@fsopti579.F-Secure.com> <16241.1316441883@sss.pgh.pa.us> <20140610143202.GI8406@alap3.anarazel.de> <30402.1402412692@sss.pgh.pa.us> <20140610150933.GK8406@alap3.anarazel.de> <30709.1402413628@sss.pgh.pa.us> <20140610153347.GM8406@alap3.anarazel.de> <31348.1402415537@sss.pgh.pa.us> Comments: In-reply-to Gurjeet Singh message dated "Tue, 10 Jun 2014 11:58:01 -0400" Date: Tue, 10 Jun 2014 12:05:56 -0400 Message-ID: <31652.1402416356@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Gurjeet Singh writes: > On Tue, Jun 10, 2014 at 11:52 AM, Tom Lane wrote: >> Robert's idea of having the start script set an environment variable to >> control the OOM adjustment reset seems like it would satisfy my concern. > I'm fine with this solution. Should this be a constant 0, or be > configurable based on env. variable's value? If we're going to do this, I would say that we should also take the opportunity to get out from under the question of which kernel API we're dealing with. So perhaps a design like this: 1. If the environment variable PG_OOM_ADJUST_FILE is defined, it's the name of a file to write something into after forking. The typical value would be "/proc/self/oom_score_adj" or "/proc/self/oom_adj". If not set, nothing happens. 2. If the environment variable PG_OOM_ADJUST_VALUE is defined, that's the string we write, otherwise we write "0". regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers