Re: bgwriter, regression tests, and default shared_buffers settings - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: bgwriter, regression tests, and default shared_buffers settings
Date
Msg-id 000e01cd6570$0d93b960$28bb2c20$@kapila@huawei.com
Whole thread Raw
In response to bgwriter, regression tests, and default shared_buffers settings  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> From: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.org] 
> On Behalf Of Tom Lane

> So that raises two independent sets of questions:

> 1. Do we like the fact that the bgwriter isn't doing anything in this
> situation?  It seems arguably OK for writes to happen only for
> checkpointing purposes if there is no memory pressure.  But having the
> bgwriter wake up 5 times a second to decide it has nothing to do seems
> a bit wasteful.  I'm inclined to think maybe it should go into the
> recently added "hibernation mode" anytime the buffer freelist isn't
> empty.  Or maybe you could argue that this scenario isn't worth any
> optimization effort, but with many-gig RAM becoming more and more
> common, I don't think I agree.

I also believe it should go to "hibernation mode" if the freelist is not
exhanusted or even it could be when freelist is less than (50% some
threshold number) used.
I have one doubt regarding this approach. According to above, what I
understood is after going to hibernation ideally it should get wakeup either
at timeout or when freelist is exhausted.
However current code wakes up before ensuring whether the buffer allocation
can be done from freelist.  

With Regards,
Amit Kapila.




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: b-tree index search algorithms
Next
From: Bruce Momjian
Date:
Subject: Re: Using pg_upgrade on log-shipping standby servers