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 1hdIYo-0006ag-7J for pgsql-general@arkaria.postgresql.org; Tue, 18 Jun 2019 18:10: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 1hdIYn-0008IC-3C for pgsql-general@arkaria.postgresql.org; Tue, 18 Jun 2019 18:10:21 +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 1hdIYl-0008Hs-Fd for pgsql-general@lists.postgresql.org; Tue, 18 Jun 2019 18:10:20 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdIYh-000531-HS for pgsql-general@lists.postgresql.org; Tue, 18 Jun 2019 18:10:19 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id AF3F222440; Tue, 18 Jun 2019 14:10:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 18 Jun 2019 14:10:13 -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=PvQyDGro6S3wh6UrOW3mTOb7obR /iWsKeJR2Pk+nkfA=; b=X+RZId2cIw/cm6zR0Bmg6HmmdYEjw2A0z7HB/Hh6xLs sG4980JVVvpFZLC5/8vhQPkrPfQPA1zQWw1y7JKFR0+lUlWUptFo1EeGnQbJbr8T XhdZZnxxkkqcDqs/0jbWnelzhSIxqg8Mu+Lk0OZ5tf1VmcFgkze8kjHabHImVe36 sFpnTlrZwIgwbpN/201kROZN1dt61OU9LCvBIzvRPOzQfXzHLrU1zKG0MC/zA+o7 LNnkug0nqc/3ymZfMVOUYT4cB6QfO5N64p1xNFrFvuji5cd7AuxRqy7POYNbL9vE alii7e9by0OSjje2um+CMSR1987hLmojgC7spP3rB2w== 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=PvQyDG ro6S3wh6UrOW3mTOb7obR/iWsKeJR2Pk+nkfA=; b=JAVAYZNYHyliSWcvYGROnl c1vjAZ3NethJwDWm+A4GK04WU6DAqjaJq9hgtcoI3Q4JN6Lkl3ILBlYT9nApJ/qq Rxd/z59+RIrwGvkB46CA9ytWSBu4K3kjovZsfXouTgmOUG7OsxpSJPVV5bD4+2eX lO1o9KihqAdvDQzrpzDw83BbZf1gKhYb6TDAsoRg+/vKZI7zSvj16P0cUIAKLv76 /jGZKkcsZhhfEVsrSbuetuQABaPyTMzPPxk9/6RTJV0Vv6FD9H3dSy2GIrEcb4tR xftVKLD4X7f6zF4MkUC8B1eKpwhqWScZdjHGY24NKVNv3N8dLVT4LhTDVXQEER9A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtddtgdelfecutefuodetggdotefrodftvf 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 912B0380086; Tue, 18 Jun 2019 14:10:12 -0400 (EDT) Date: Tue, 18 Jun 2019 11:10:11 -0700 From: Andres Freund To: Fabio Ugo Venchiarutti Cc: Jeff Janes , Michael Curry , pgsql-general Subject: Re: perf tuning for 28 cores and 252GB RAM Message-ID: <20190618181011.hspcoxmi6mu4cq5h@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-18 17:13:20 +0100, Fabio Ugo Venchiarutti wrote: > Does the backend mmap() data files when that's possible? No. That doesn't allow us to control when data is written back to disk, which is crucial for durability/consistency. > I've heard the "use the page cache" suggestion before, from users and > hackers alike, but I never quite heard a solid argument dismissing potential > overhead-related ill effects of the seek() & read() syscalls if they're > needed, especially on many random page fetches. We don't issue seek() for reads anymore in 12, instead do a pread() (but it's not a particularly meaningful performance improvement). The read obviously has cost, especially with syscalls getting more and more expensive due to the mitigation for intel vulnerabilities. I'd say that a bigger factor than the overhead of the read itself is that for many workloads we'll e.g. incur additional writes when s_b is smaller, that the kernel has less information about when to discard data, that the kernel pagecaches have some scalability issues (partially due to their generality), and double buffering. > Given that shmem-based shared_buffers are bound to be mapped into the > backend's address space anyway, why isn't that considered always > preferable/cheaper? See e.g. my point in my previous email in this thread about drop/truncate. > I'm aware that there are other benefits in counting on the page cache (eg: > staying hot in the face of a backend restart), however I'm considering > performance in steady state here. There's also the issue that using a large shared buffers setting means that each process' page table gets bigger, unless you configure huge_pages. Which one definitely should - but that's an additional configuration step that requires superuser access on most operating systems. Greetings, Andres Freund