pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Joao Junior <jcoj2006@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: shared buffers and startup process
Date: Wed, 15 Jan 2020 11:48:00 +0900
Message-ID: <20200115024800.GD2243@paquier.xyz> (raw)
In-Reply-To: <CABnPa_iu8LB=g-Cau8BhvJ1M4rOKRxZK-qzKdzvoG=1=2rbZbQ@mail.gmail.com>
References: <CABnPa_iu8LB=g-Cau8BhvJ1M4rOKRxZK-qzKdzvoG=1=2rbZbQ@mail.gmail.com>

On Tue, Jan 14, 2020 at 04:29:51PM +0100, Joao Junior wrote:
> I would like to know if  increasing the amount of shared-buffers could help
> the startup process applying the wals. I would like to know if in
> the process of reading the wals and applying them,  blocks that should be
> written will be  brought to shared buffer or not??

Please feel free to look at XLogReadBufferForRedo() in xlogutils.c and
check what the routine does, and when/where it gets called.  The code
is well-documented, so you will find your answer easily.

> If yes, having a bigger
> shared buffer will keep as much as possible the amount of pages there and
> increase the startup process's speed avoiding pages's replacement and going
> to the OS cache and maybe to the disk .
> Does it make sense?

It does.  Even if relying on the OS cache would be enough in most
cases, it is good to keep a certain of pages hot enough, and you need
to be careful with not setting shared_buffers too high either.
--
Michael

Attachments:

  [application/pgp-signature] signature.asc (832B, ../20200115024800.GD2243@paquier.xyz/2-signature.asc)
  download

view thread (2+ messages)

Message-ID: <20200115024800.GD2243@paquier.xyz>
Permalink:  ../20200115024800.GD2243@paquier.xyz/
Also on:    postgresql.org/message-id/20200115024800.GD2243@paquier.xyz

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: michael@paquier.xyz, jcoj2006@gmail.com
  Subject: Re: shared buffers and startup process
  In-Reply-To: <20200115024800.GD2243@paquier.xyz>

* 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