Re: Dirty Buffer Writing [was Proposed LogWriter Scheme]

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Curtis Faith <curtis(at)galtair(dot)com>
Cc: Greg Copeland <greg(at)copelandconsulting(dot)net>, Pgsql-Hackers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Dirty Buffer Writing [was Proposed LogWriter Scheme]
Date: 2002-10-07 20:28:48
Message-ID: 200210072028.g97KSmW06617@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Curtis Faith 2002-10-07 20:43:20 Re: Dirty Buffer Writing [was Proposed LogWriter Scheme]
Previous Message Tom Lane 2002-10-07 20:27:06 Re: Analysis of ganged WAL writes