From owner-freebsd-stable@FreeBSD.ORG Tue Apr 28 09:51:20 2015 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E6EB254 for ; Tue, 28 Apr 2015 09:51:20 +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 31AD5129F for ; Tue, 28 Apr 2015 09:51:19 +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 1Yn2AT-00063F-Jl for freebsd-stable@freebsd.org; Tue, 28 Apr 2015 11:51:10 +0200 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: freebsd-stable@freebsd.org Subject: Re: protecting some processes from out-of-swap killer References: <20150425104336.GD13141@ivaldir.etoilebsd.net> Date: Tue, 28 Apr 2015 11:51:03 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: 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.2 X-Scan-Signature: 2ecd0b53b7de9511489f92806276a3d7 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: Tue, 28 Apr 2015 09:51:20 -0000 On Sat, 25 Apr 2015 13:15:32 +0200, Dmitry Morozovsky wrote: > On Sat, 25 Apr 2015, Baptiste Daroussin wrote: > >> > However, sometimes postgres processes got killed by 'out of swap >> space'. >> > I suppose the source of problem could be that VSZ size of postgres >> processes >> > (8-9 G) is bigger than swap congigured (4G). >> > >> > Is there any way to prevent this, besides reallocating space for swap? >> >> protect(1) ? > > Of course. I really do not understand how google hides the man page > from me. > > Thanks, and sorry fot the noise. > 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 Regards, Ronald.