Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint - Mailing list pgsql-hackers

From Zeugswetter Andreas SB SD
Subject Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA49620A4@m0114.s-mxs.net
Whole thread Raw
List pgsql-hackers
> People keep saying that the bgwriter mustn't write pages synchronously
> because it'd be bad for performance, but I think that analysis is
> faulty.  Performance of what --- the bgwriter?  Nonsense, the *point*

Imho that depends on the workload. For a normal OLTP workload this is
certainly correct. I do not think it is correct for mass loading,
or an otherwise IO bound db.

> of the bgwriter is to do the slow tasks.  The only argument that has
> any merit is that O_SYNC or immediate fsync will prevent us from having
> multiple writes outstanding and thus reduce the efficiency of disk
> write scheduling.  This is a valid point but there is a limit to how
> many writes we need to have in flight to keep things flowing smoothly.

But that is imho the main point. The difference for modern disks
is 1Mb/s for random 8k vs. 20 Mb/s for random 256k.

Don't understand me wrong I think sync writing would achieve maximum performance,
but you have to try to write physically adjacent 256k, and you need a vague
idea which blocks to write in parallel. And since that is not so easy I think
we could leave it to the OS.

And as an aside I think 20-30 minute checkpoint intervals would be sufficient
with a bgwriter.

Andreas

Ps: don't most syncers have 60s intervals, not 30 ?


pgsql-hackers by date:

Previous
From: Austin Gonyou
Date:
Subject: Re: PITR Dead horse?
Next
From: "Nicolai Tufar"
Date:
Subject: Re: PITR Dead horse?