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 1hdH3E-0003MC-0m for pgsql-general@arkaria.postgresql.org; Tue, 18 Jun 2019 16:33:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hdH3C-0004mj-TS for pgsql-general@arkaria.postgresql.org; Tue, 18 Jun 2019 16:33:38 +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 1hdH3C-0004kn-Jq for pgsql-general@lists.postgresql.org; Tue, 18 Jun 2019 16:33:38 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdH39-0002xo-Rs for pgsql-general@lists.postgresql.org; Tue, 18 Jun 2019 16:33:38 +0000 Received: by mail-qt1-x843.google.com with SMTP id j19so16071400qtr.12 for ; Tue, 18 Jun 2019 09:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=41bEHvl01Po38SSuT1t8ukdWbDGGQtuOn9MIBdOfr9g=; b=g6iyqXH8N3Uk2UK8+RiLDSgWSDg57KFbtcT37PoHJ1V5Ob8IxXpl/vgCfDLdzjhK/C vTrug/upLabEF9ceUyL/BrTp3fTEf5KNHLNH1ekGXktK9rSe1EOusJ9jrubzlKsijhiY m9B9kiRGO8g08xZtPPtxUwgXP6mpLlAMuRJOs/vcIl9TVS/NCMIt3jkG10AHjmWc7erG Hr5aUZZGc6a9T6w4X6V84tlNNsZEFXJs6du40486tiJC20+QV/3swhb9jgT91WALynZV GEZPpM50w7Oulk/K/mKEHFM6rHclP+vPYn8ENDDnajq2QyH8c30V1HrLk4rav+FYCmAW R71A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=41bEHvl01Po38SSuT1t8ukdWbDGGQtuOn9MIBdOfr9g=; b=RsEPlmE4O7MPzNxWZb7mFxiSXGd4UVUgzAOmPuO4EC/EPQKLPRbwgcyxo2KwopBScO xUzyLPQsGEfnx/Koci/Pwv/oxMjs98nJAXaL+HD9jaYv9HmUqPTXnV7fX0U9fgdfn30H pMnZkA4atInrov1jOBpo1bg05hMeA5r7M/nOWU15vVKWmQ2EFVctUrgNbFowZX0HVVhK Da0k3sYQcHFzLqMbzcJBd9+ZFy1X0OKAwFSGPXFlUtnMNIp2mbIDB5vUTG15evGc5hXL vKxERCbjFJXEeRyEmi1Q1fnlroq6+cP6icTQ2Ga0UXpoZuOK3dRSa1pMTLejc8vWDGhB Nteg== X-Gm-Message-State: APjAAAWu9RO+wKPrvy0MmMfj3MUA+XijYfnZ858TOY2Dx2zEKIb6yRYx O7YVwZlsGsVKAB1zT8M6zZDIpw== X-Google-Smtp-Source: APXvYqzXPMaRNwqceNlhBGCAU1E6VYg+eamyCTXsQJvfovIUneLqHtv1gwuWTXo1EMEKN5jQNBLvsQ== X-Received: by 2002:aed:37a1:: with SMTP id j30mr3749350qtb.367.1560875613860; Tue, 18 Jun 2019 09:33:33 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.217.181.124]) by smtp.gmail.com with ESMTPSA id k6sm7926101qkd.21.2019.06.18.09.33.32 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 18 Jun 2019 09:33:33 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 0BFF512076F; Tue, 18 Jun 2019 12:33:30 -0400 (-04) Date: Tue, 18 Jun 2019 12:33:30 -0400 From: Alvaro Herrera To: Andres Freund Cc: Jeff Janes , Michael Curry , pgsql-general Subject: Re: perf tuning for 28 cores and 252GB RAM Message-ID: <20190618163329.GA13693@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190618161802.rilpi6c7qqsspnbk@alap3.anarazel.de> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello On 2019-Jun-18, Andres Freund wrote: > 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). One additional tuning point in this area is that you need to tweak the Linux flusher so that it starts writing earlier than what it does by default (by setting dirty_background_bytes to some reasonable value -- as I recall it normally runs on the dirty_background_ratio setting, which means it scales up when you add RAM, which I'm not sure is really sensible since you really care about the disk I/O write rate rather than anything about the memory). If you don't do that, the kernel can accumulate lots of memory to write before starting to write it, which is troublesome once it does. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services