From: Stephen Frost <sfrost@snowman.net>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: tfoertsch123@gmail.com
Cc: Postgres General <pgsql-general@postgresql.org>
Subject: Re: Is there a way to speed up WAL replay?
Date: Wed, 31 Oct 2018 11:32:53 -0400
Message-ID: <20181031153252.GY4184@tamriel.snowman.net> (raw)
In-Reply-To: <CAMkU=1xQAngSBQaqw33bo0mv+JLz7+Ao_0p0k3ZbrEK7rHASkA@mail.gmail.com>
References: <CAKkG4_nRs+wiDpBrhAU=76XHMBFi08Hb47HD_Fvn0q-+U-h5-A@mail.gmail.com>
<CAMkU=1xQAngSBQaqw33bo0mv+JLz7+Ao_0p0k3ZbrEK7rHASkA@mail.gmail.com>
Greetings,
* Jeff Janes (jeff.janes@gmail.com) wrote:
> One way I found to speed up restore_command is to have another program run
> a few WAL files ahead of it, copying the WAL from the real archive into a
> scratch space which is on the same filesystem as pg_xlog/pg_wal. Then have
> restore_command simply move (not copy) the requested files from the scratch
> space onto %p. The intra-filesystem move completes much faster than a copy.
Right, that can definitely be a big help and is more-or-less what
pgbackrest does too.
> If it spends time waiting for blocks that need to be recovered into to get
> read from disk, and you have enough RAM, you could speed it up by
> pre-warming the file system cache. Something like:
>
> tar -cf - $PGDATA | wc -c
Yeah, that's also a good idea. We've discussed having something in
pgbackrest to basically go pre-load things off disk in advance of WAL
replay, and I seem to recall someone had also written an external tool
to do that.
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
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: sfrost@snowman.net, jeff.janes@gmail.com, tfoertsch123@gmail.com
Subject: Re: Is there a way to speed up WAL replay?
In-Reply-To: <20181031153252.GY4184@tamriel.snowman.net>
References: <CAKkG4_nRs+wiDpBrhAU=76XHMBFi08Hb47HD_Fvn0q-+U-h5-A@mail.gmail.com> <CAMkU=1xQAngSBQaqw33bo0mv+JLz7+Ao_0p0k3ZbrEK7rHASkA@mail.gmail.com> <20181031153252.GY4184@tamriel.snowman.net>
* 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