On 2006-06-02 21:26, Jim Nasby wrote:
> Now that we've got a nice amount of tuneability in the bgwriter, it
> would be nice if we had as much insight into how it's actually doing.
> I'd like to propose that the following info be added to the stats
> framework to assist in tuning it:
I'm interested in your idea. You want to know what bgwriter does.
Also, I think there is another perspective; what bgwriter *should* do.
I imagine the information that pages are dirty or not is useful for
The number of pages with BM_DIRTY in the buffer pool.
Total replaced pages with BM_DIRTY.
Backends should write the pages themselves.
Same as above, but without BM_DIRTY.
Backends can replace them freely.
Bgwriter should boost ALL activity if dirty_pages is high,
and boost LRU activity if replaced_dirty is high.
In ideal, the parameters of bgwriter can be tuned almost automatically:
- LRU scans = replaced_dirty + replaced_clean
- LRU writes = replaced_dirty
- ALL scans/writes = the value that can keep dirty_pages low
However, tracking the number of dirty pages is not free. I suppose
the implementation should be well considered to avoid lock contentions.
Comments are welcome.
NTT OSS Center
In response to
pgsql-hackers by date
|Next:||From: Hannu Krosing||Date: 2006-06-05 09:28:08|
|Subject: Re: More thoughts about planner's cost estimates|
|Previous:||From: Bruce Momjian||Date: 2006-06-05 03:55:29|
|Subject: Re: Re [HACKERS]: Still not happy with psql's multiline history behavior|