Re: shared buffers and startup process

Michael Paquier <[email protected]> Wed, 15 Jan 2020 11:48:00 +0900
Newsgroups gmane.comp.db.postgresql.performance
Message-ID <[email protected]>
--l06SQqiZYCi8rTKz
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

--l06SQqiZYCi8rTKz
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl4efWAACgkQnvQgOdby
QH0Amw/+K9Br3nEU8meDulpdeX2jJeaLNo4qrS7PriBYAKfeje9Mh//nf6mdkSUl
Xlhou93xICv3roGMwuhG9gMSIZ0qVsgYDvf+PwAg+5NXp8PC3ID/nk5NMXQwuyzo
fDqHJ48ySjFgbqMgt+I6ZcspTv0TcOgbPhXXFdUF2jg2h7x93Sl4MXx961AgtyDh
mZwmUW2lWQ2kn+wnMrgFBK8qD1m4hPpAsD0mm1D38mxnwUiy+CwAroCFSSBpocIc
hgoGxQ3os51D5s+KiMpIATa+KdgtpxDU87nQuvjPGTGMeMWLBIIuga8gGkNfqJTq
VU1e6882Fox6GZa5f3CvJteY+Z3g5yMx34nExvyxCZY0RzqzNUmjJcQUx4GatC0p
LjDQCvUT5yc+pbMlXHuLJfBHfoUiZDd01Hn3F+Yw+qXf22b3maQWN+YbRiWMFkkP
ATl1/qcL+K2oJ0eoBsw1xw/pWtlT+MRrBd0hwkwOVXF6M8OoOly/ZjIA0DH5NKLk
P/rimu9F934zIOoTPudDaU7m/czxNltE/gCHW1rtLIFtuxk1GUrkPtjjSuty0qLB
+sdBhzOdZaa5oG6qlEuoSXnlMyguCtjRawSLAXfeiv4KPxUqkCJjEtqGaNcH+9pk
5RsvlJ1qTyYpRy6EM9kUc1FwYHsC7cE+dDRp3d6hv61nlPnri1o=
=tfBc
-----END PGP SIGNATURE-----

--l06SQqiZYCi8rTKz--