From: Andres Freund <andres@anarazel.de>
To: Fabio Ugo Venchiarutti <f.venchiarutti@ocado.com>
Cc: 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 11:10:11 -0700
Message-ID: <20190618181011.hspcoxmi6mu4cq5h@alap3.anarazel.de> (raw)
In-Reply-To: <aec848d3-db99-9f53-bbfc-0d029d03207f@ocado.com>
References: <CAEqv4-34dyUErMcB3mwyD6MB+ckH_HFqMQg3Hb2F81NhjP78cw@mail.gmail.com>
<CAMkU=1wK1GJi7_pFV_jLxrhUyNzaUvVB3vvv=sSNdKD7O5fbMg@mail.gmail.com>
<aec848d3-db99-9f53-bbfc-0d029d03207f@ocado.com>
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
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, f.venchiarutti@ocado.com, jeff.janes@gmail.com, curry@cs.umd.edu
Subject: Re: perf tuning for 28 cores and 252GB RAM
In-Reply-To: <20190618181011.hspcoxmi6mu4cq5h@alap3.anarazel.de>
References: <CAEqv4-34dyUErMcB3mwyD6MB+ckH_HFqMQg3Hb2F81NhjP78cw@mail.gmail.com> <CAMkU=1wK1GJi7_pFV_jLxrhUyNzaUvVB3vvv=sSNdKD7O5fbMg@mail.gmail.com> <aec848d3-db99-9f53-bbfc-0d029d03207f@ocado.com> <20190618181011.hspcoxmi6mu4cq5h@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