Re: PG 9.2 slave restarted - cache not impacted - Mailing list pgsql-general

From Michael Paquier
Subject Re: PG 9.2 slave restarted - cache not impacted
Date
Msg-id 20201023031959.GB5180@paquier.xyz
Whole thread Raw
In response to PG 9.2 slave restarted - cache not impacted  (Lucas Possamai <drum.lucas@gmail.com>)
List pgsql-general
On Fri, Oct 23, 2020 at 11:23:20AM +1300, Lucas Possamai wrote:
> I'm a bit confused about PG cache.
>
> I have a PostgreSQL 9.2 cluster (yes, we're planning on upgrading it to 12)
> with a master and a slave database.
>
> The application is sending all read requests to the slave, where the master
> processes the writes.
>
> A while ago we had to restart the master database server, and the
> application was slow for a couple of days while PG cache was warmed up.
> Yesterday, we had to restart the slave database server and we did not have
> the same problem.
>
> I would like to understand why?

Perhaps you misunderstood the effects of the OS cache and the Postgres
shared buffers?  On restart the cluster discards the shared buffers
internal to Postgres.  It does not mean that the OS cache is changed,
and it matters a lot in terms of performance.  By the way, if you want
to warm up your caches faster, an option you can consider with 9.2
(which is a version not officially supported by the community by the
way so please upgrade) would be to use pgfincore.
--
Michael

Attachment

pgsql-general by date:

Previous
From: Lucas Possamai
Date:
Subject: PG 9.2 slave restarted - cache not impacted
Next
From: Philip Semanchuk
Date:
Subject: Re: postgres materialized view refresh performance