From: Andres Freund <andres@anarazel.de>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: Michael Curry <curry@cs.umd.edu>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: perf tuning for 28 cores and 252GB RAM
Date: Tue, 18 Jun 2019 09:18:02 -0700
Message-ID: <20190618161802.rilpi6c7qqsspnbk@alap3.anarazel.de> (raw)
In-Reply-To: <CAMkU=1wK1GJi7_pFV_jLxrhUyNzaUvVB3vvv=sSNdKD7O5fbMg@mail.gmail.com>
References: <CAEqv4-34dyUErMcB3mwyD6MB+ckH_HFqMQg3Hb2F81NhjP78cw@mail.gmail.com>
<CAMkU=1wK1GJi7_pFV_jLxrhUyNzaUvVB3vvv=sSNdKD7O5fbMg@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: andres@anarazel.de, jeff.janes@gmail.com, curry@cs.umd.edu
Subject: Re: perf tuning for 28 cores and 252GB RAM
In-Reply-To: <20190618161802.rilpi6c7qqsspnbk@alap3.anarazel.de>
References: <CAEqv4-34dyUErMcB3mwyD6MB+ckH_HFqMQg3Hb2F81NhjP78cw@mail.gmail.com> <CAMkU=1wK1GJi7_pFV_jLxrhUyNzaUvVB3vvv=sSNdKD7O5fbMg@mail.gmail.com> <20190618161802.rilpi6c7qqsspnbk@alap3.anarazel.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox