From owner-freebsd-stable@FreeBSD.ORG Thu Apr 30 08:59:49 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 A22427C7 for ; Thu, 30 Apr 2015 08:59:49 +0000 (UTC) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6360F1614 for ; Thu, 30 Apr 2015 08:59:48 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1YnkJi-0006tz-2y; Thu, 30 Apr 2015 10:59:39 +0200 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: "David Magda" Cc: freebsd-stable@freebsd.org Subject: Re: protecting some processes from out-of-swap killer References: <20150425104336.GD13141@ivaldir.etoilebsd.net> <61abe503a5bc8550e1413fd1933bea62.squirrel@webmail.ee.ryerson.ca> Date: Thu, 30 Apr 2015 10:59:32 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <61abe503a5bc8550e1413fd1933bea62.squirrel@webmail.ee.ryerson.ca> User-Agent: Opera Mail/1.0 (Win32) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: - X-Spam-Score: -1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED, BAYES_40, URIBL_BLOCKED autolearn=disabled version=3.3.1 X-Scan-Signature: 5a1627636b35b65657045ef62631cd80 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: Thu, 30 Apr 2015 08:59:49 -0000 On Wed, 29 Apr 2015 19:09:05 +0200, David Magda wrote: > 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.) > > See sysctl vm.overcommit, which is also documented here: https://wiki.freebsd.org/SystemTuning and in man tuning(7). Regards, Ronald.