Thread: Sum of written buffers bigger than allocation?

Sum of written buffers bigger than allocation?

From
pinker
Date:
Hi All!

First time I see that the sum of written buffers:
3765929+878326121 = 882092050 = select
pg_size_pretty(882092050::numeric*8192) = 6730 GB

is bigger than buffers_alloc value in pg_stat_bgwriter view:
buffers_alloc         | 20426161 = 156 GB


buffers_checkpoint    | 878599316
buffers_clean         | 0
maxwritten_clean      | 0
buffers_backend       | 3766409
buffers_backend_fsync | 0
buffers_alloc         | 20426161


It's kinda mysterious... Any explanations?
Does it mean that the same buffers were written over and over again?





--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html


Re: Sum of written buffers bigger than allocation?

From
Jeff Janes
Date:


On Sun, Apr 8, 2018 at 11:28 AM, pinker <pinker@onet.eu> wrote:


It's kinda mysterious... Any explanations?
Does it mean that the same buffers were written over and over again?


Yeah, checkpoints will write all dirty buffers, but doesn't evict them.  Next time the page is needed, it doesn't need to be re-read as it is still there.

Cheers,

Jeff