Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g31pT-00032K-PC for pgsql-general@arkaria.postgresql.org; Thu, 20 Sep 2018 16:29:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g31pS-000542-7p for pgsql-general@arkaria.postgresql.org; Thu, 20 Sep 2018 16:29:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g31pR-00053v-W5 for pgsql-general@lists.postgresql.org; Thu, 20 Sep 2018 16:29:22 +0000 Received: from mx2a.mailbox.org ([2001:67c:2050:104:0:2:25:2] helo=mx2.mailbox.org) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g31pL-0007x5-8t for pgsql-general@postgresql.org; Thu, 20 Sep 2018 16:29:21 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id E3D2F4113C; Thu, 20 Sep 2018 18:29:10 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id tslqHDFtOPs3; Thu, 20 Sep 2018 18:29:09 +0200 (CEST) Message-ID: <050eac454fe64eaca639dd7f166ee1fb01bc9cad.camel@cybertec.at> Subject: Re: Advice on machine specs for growth From: Laurenz Albe To: Steven Winfield , "pgsql-general@postgresql.org" Date: Thu, 20 Sep 2018 18:29:07 +0200 In-Reply-To: References: <20180918135705.thfl6jllgcf5v3i3@campbell-lange.net> <73d25c37c98cebd99cbee57583502aeb3bdd6c0e.camel@cybertec.at> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Steven Winfield wrote: > Just to be clear, are you suggesting (on linux) setting overcommit_memory = 2 > but leaving overcommit_ratio alone, which defaults to 50%? > I’ve tried setting them to 2 and 0% respectively in the past and it didn’t end well… Yes, vm.overcommit_memory = 2 As for vm.overcommit ratio, set it to 100 * (RAM - swap) / RAM That is because Linux will commit memory up to swap + overcommit_ratio * RAM / 100, and you don't want to commit more than the available RAM. > Also I’ve read, and now use, swappiness = 1 which is supposed to disable swapping > entirely except when not swapping would cause OOM. > Any thoughts on that? My thought is vm.swappiness = 0 If you don't overcommit memory, you should never have to swap. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com