Re: Dirty Buffer Writing [was Proposed LogWriter Scheme] - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Dirty Buffer Writing [was Proposed LogWriter Scheme]
Date
Msg-id 200210072028.g97KSmW06617@candle.pha.pa.us
Whole thread Raw
In response to Dirty Buffer Writing [was Proposed LogWriter Scheme]  ("Curtis Faith" <curtis@galtair.com>)
Responses Re: Dirty Buffer Writing [was Proposed LogWriter Scheme]  ("Curtis Faith" <curtis@galtair.com>)
Re: Dirty Buffer Writing [was Proposed LogWriter Scheme]  (Greg Copeland <greg@CopelandConsulting.Net>)
List pgsql-hackers
Curtis Faith wrote:
> Good points.
> 
> Now for some surprising news (at least it surprised me).
> 
> I researched the file system source on my system (FreeBSD 4.6) and found
> that the behavior was optimized for non-database access to eliminate
> unnecessary writes when temp files are created and deleted rapidly. It was
> not optimized to get data to the disk in the most efficient manner.
> 
> The syncer on FreeBSD appears to place dirtied filesystem buffers into
> work queues that range from 1 to SYNCER_MAXDELAY. Each second the syncer
> processes one of the queues and increments a counter syncer_delayno.
> 
> On my system the setting for SYNCER_MAXDELAY is 32. So each second 1/32nd
> of the writes that were buffered are processed. If the syncer gets behind
> and the writes for a given second exceed one second to process the syncer
> does not wait but begins processing the next queue.
> 
> AFAICT this means that there is no opportunity to have writes combined by
> the  disk since they are processed in buckets based on the time the writes
> came in.

This is the trickle syncer.  It prevents bursts of disk activity every
30 seconds.  It is for non-fsync writes, of course, and I assume if the
kernel buffers get low, it starts to flush faster.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Analysis of ganged WAL writes
Next
From: Hannu Krosing
Date:
Subject: Re: Analysis of ganged WAL writes