Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WuNbm-00011W-2D for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Jun 2014 15:05:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WuNbl-0007Pf-J3 for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Jun 2014 15:05:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WuNbk-0007PU-JV for pgsql-hackers@postgresql.org; Tue, 10 Jun 2014 15:05:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WuNbh-0007AW-6T for pgsql-hackers@postgresql.org; Tue, 10 Jun 2014 15:05:02 +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 s5AF4q1i030403; Tue, 10 Jun 2014 11:04:52 -0400 From: Tom Lane To: Andres Freund cc: Gurjeet Singh , Peter Eisentraut , PGSQL Hackers Subject: Re: /proc/self/oom_adj is deprecated in newer Linux kernels In-reply-to: <20140610143202.GI8406@alap3.anarazel.de> 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> Comments: In-reply-to Andres Freund message dated "Tue, 10 Jun 2014 16:32:02 +0200" Date: Tue, 10 Jun 2014 11:04:52 -0400 Message-ID: <30402.1402412692@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 Andres Freund writes: > Independent of the rest of the discussion, I think there's one more > point: Trying to keep your system stable by *increasing* the priority of > normal backends is a bad idea. If you system gets into OOM land you need > to fix that, not whack who gets killed around. > The reason it makes sense to increase the priority of the postmaster is > that that *does* increase the stability by cleaning up resources and > restarting everything. That's half of the reason. The other half is that, at least back when we added this code, the Linux kernel's victim-selection code disproportionately chose to kill the postmaster rather than any child backend, an outcome definitely not to be preferred. IIRC this was because it blamed the postmaster for the sum of childrens' memory sizes *including shared memory*, counting the shared memory over again for each child. I don't know whether our switch away from SysV shmem has helped that, or if recent kernel versions have less brain-dead OOM victim selection. I'm not terribly hopeful though. But anyway, yeah, the point of this feature is that the OOM priority of the postmaster, and *only* the postmaster, should be raised. Allowing unprivileged people to break that is not attractive on any level. 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