From owner-freebsd-stable@FreeBSD.ORG Wed Apr 29 17:27:02 2015 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F2AAA15 for ; Wed, 29 Apr 2015 17:27:02 +0000 (UTC) Received: from eccles.ee.ryerson.ca (eccles.ee.ryerson.ca [141.117.1.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB4421D9A for ; Wed, 29 Apr 2015 17:27:01 +0000 (UTC) Received: from webmail.ee.ryerson.ca (eccles [172.16.1.2]) by eccles.ee.ryerson.ca (8.14.9/8.14.9) with ESMTP id t3TH94PG063726; Wed, 29 Apr 2015 13:09:04 -0400 (EDT) (envelope-from dmagda@ee.ryerson.ca) Received: from 206.108.127.2 (SquirrelMail authenticated user dmagda) by webmail.ee.ryerson.ca with HTTP; Wed, 29 Apr 2015 13:09:05 -0400 Message-ID: <61abe503a5bc8550e1413fd1933bea62.squirrel@webmail.ee.ryerson.ca> In-Reply-To: References: <20150425104336.GD13141@ivaldir.etoilebsd.net> Date: Wed, 29 Apr 2015 13:09:05 -0400 Subject: Re: protecting some processes from out-of-swap killer From: "David Magda" To: "Ronald Klop" Cc: freebsd-stable@freebsd.org User-Agent: SquirrelMail/1.4.23 [SVN] MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (eccles.ee.ryerson.ca [172.16.1.2]); Wed, 29 Apr 2015 13:09:05 -0400 (EDT) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 17:27:02 -0000 On Tue, April 28, 2015 05:51, Ronald Klop wrote: > The OS trying to kill a process is probably not what you want. So when you > protect(1) postgres the OS will kill another process, which I hope is not > running without reason. > My advice would be to > - or increase your swap space > - or tune postgresql to use less memory > - or limit tmpfs (tmpfs uses swap if RAM is short) > - or tune zfs to use less memory Personally I didn't even know FreeBSD had an OOM killer. I regularly run into Linux's though, but that's because by default Linux allows over-committing of memory. I was under the impression that FreeBSD did not over-subscribe memory, and so would not allow a process to do a malloc() unless there was enough RAM+swap to satisfy it. Is this a mistaken assumption? (I probably have to buy the McKusick, Neville-Neil, Watson book.)