Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdGoI-0002lF-1a for pgsql-general@arkaria.postgresql.org; Tue, 18 Jun 2019 16:18:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hdGoG-0006xf-TI for pgsql-general@arkaria.postgresql.org; Tue, 18 Jun 2019 16:18:12 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdGoF-0006xX-BM for pgsql-general@lists.postgresql.org; Tue, 18 Jun 2019 16:18:12 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdGoB-0002mh-G5 for pgsql-general@lists.postgresql.org; Tue, 18 Jun 2019 16:18:11 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 17EF92231C; Tue, 18 Jun 2019 12:18:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 18 Jun 2019 12:18:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=tYcmbSGmDFJndCLDkCekrsLDiSm JnEnmqH3+Zm6wPh0=; b=lDiQggp5gmZjeZvpgwy9uHN8MwuPNrcvMNRrc7Ra7e3 S9SF4xKx8KZOGBRUjtdWCSZjZq0crWkskaZ2tLEB7LNsymxlxHgJBPExgpB6231S oirTDzbtSzTIkdBYoHjfTcQln5rugQLB0yrqEXqPhNxQ3X2zH0M2tIqSnXOg1Jgs bkuqDY3oZcVnie4WSW4QabglusW9Bxikrst/5XBD4C6Opa8YrszyTwU2F+QsDcKt YgrtGiYMA7H7VtPt8nTGm8SQgAUEs1w7ieT8plk7EJ7IAasL6OSJ94CLJs3K3Jwk Tupzts5fX0v/YNAJEYsS0y/OwK3t1MH/vkXggYdNbng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=tYcmbS GmDFJndCLDkCekrsLDiSmJnEnmqH3+Zm6wPh0=; b=X4oGgFT+/ADkop8viMF9ut 0h/Hdhpgx2Z0BJ6rwbMlkbR7zoNlQP0OY+Vv1+EjX9sYAz6VzSWOdxGoG7a1cRFG V6hN6hEMIlITjYL1STZ15iiyC/TsnTcytABGGKq+E5eB1PlX6SPOMDTQeOogUgst QG4rE0qTGGBkFdh6DsKh+cZ41KXF8e+N4osk90JDyiHln5KkIUKw1Qi0NgKqe08Z oWVnUF886dxxg1hC0ZShp24M+FGXOS6y0Q9q+lQ4h70pveuAc1CZ79OpOogQYS5U UrT+dakZHOW2HU3K41g5yx60x5LPORCwKJGXFuVLOI0B7zUZKgsUeEyrIVQNYnAA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtddtgdejtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecukfhppeeije drudeitddrvddukedrvdefjeenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghs segrnhgrrhgriigvlhdruggvnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-218-237.hsd1.ca.comcast.net [67.160.218.237]) by mail.messagingengine.com (Postfix) with ESMTPA id 45E2980071; Tue, 18 Jun 2019 12:18:04 -0400 (EDT) Date: Tue, 18 Jun 2019 09:18:02 -0700 From: Andres Freund To: Jeff Janes Cc: Michael Curry , pgsql-general Subject: Re: perf tuning for 28 cores and 252GB RAM Message-ID: <20190618161802.rilpi6c7qqsspnbk@alap3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2019-06-17 19:45:41 -0400, Jeff Janes wrote: > If not, I would set the value small (say, 8GB) and let the OS do the > heavy lifting of deciding what to keep in cache. FWIW, in my opinion this is not a good idea in most cases. E.g. linux's pagecache doesn't scale particularly gracefully to large amounts of data, and it's decisions when to evict data aren't really better than postgres'. And there's a significant potential for additional unnecessary disk writes (because the kernel will flush dirty pagecache buffers, and then we'll just re-issue many of those writes again). It's a bit hard to be specific without knowing the workload, but my guidance would be that if the data has some expected form of locality (e.g. index lookups etc, rather than just sequentially scanning the whole database) then sizing s_b for at least the amount of data likely to be repeatedly accessed can be quite beneficial. If increasing s_b can achieve that most writes can be issued by checkpointer rather than backends and bgwriter, the generated IO pattern is *far* superior since 9.6 (as checkpointer writes are sorted, whereas bgwriter/backend writes aren't to a meaningful degree). The one big exception is if the workload frequently needs to drop/truncate non-temporary tables. There we currently linearly need to search shared_buffers, which, although the constants are fairly small, obviously means that drop/truncations get noticably slower with a larger shared_buffers. - Andres