Re: ACM Paper relevant to our buffer algorithm - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ACM Paper relevant to our buffer algorithm
Date
Msg-id 26567.1183566024@sss.pgh.pa.us
Whole thread Raw
In response to Re: ACM Paper relevant to our buffer algorithm  (Gregory Stark <gsstark@mit.edu>)
Responses Re: ACM Paper relevant to our buffer algorithm  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark <gsstark@mit.edu> writes:
> Heikki Linnakangas <heikki@enterprisedb.com> writes:
>> I'm still struggling to understand why and how bgwriter increases performance.
>> Under what circumstances, what workload?
>> 
>> The only benefit I can see is that it moves the write() of a page out of the
>> critical path. But as long as the OS cache can absorb the write, it should be
>> very cheap compared to doing real I/O. 

> Well you can't keep writing indefinitely faster than the i/o subsystem can
> execute the writes. Eventually the kernel will block your write until a kernel
> buffer becomes free. Ie, throttle your writes to the actual write bandwidth
> available.

Right.  Also, a buffer write isn't "merely" a kernel call --- for
instance, you might have to flush some more WAL before you can execute
the write, and there are cases where you'd have to fsync the write
yourself (ie, if you can't pass it off to the bgwriter).  The more of
that we can take out of foreground query paths, the better.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Darcy Buskermolen
Date:
Subject: Re: Why so many out-of-disk-space failures on buildfarm machines?
Next
From: Tom Lane
Date:
Subject: Re: Dead code as a result of plan cache invalidation?