Re: win32 performance - fsync question

From: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: win32 performance - fsync question
Date: 2005-02-18 03:18:10
Message-ID: cv3n1e$18bo$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


""Magnus Hagander"" <mha(at)sollentuna(dot)net>
news:6BCB9D8A16AC4241919521715F4D8BCE4768DD(at)algol(dot)sollentuna(dot)se(dot)(dot)(dot)
>
> This is what we have discovered. AFAIK, all other major databases or
> other similar apps (like exchange or AD) all open files with
> FILE_FLAG_WRITE_THROUGH and do *not* use fsync. It might give noticably
> better performance with an O_DIRECT style WAL logging at least. But I'm
> unsure if the current code for O_DIRECT works on win32 - I think it
> needs some fixing for that. Which might be worth looking at for 8.1.
>
>
> UPS will not help you. UPS does not help you if the OS crashes (hey,
> yuo're on windows, this *does* happen). UPS does not help you if
> somebody accidentally pulls the plug between the UPS and the server. UPS
> does not help you if your server overheats and shuts down.
> Bottom line, there are lots of cases when an UPS does not help. Having
> an UPS (preferrably redundant UPSes feeding redundant power supplies -
> this is not at all expensive today) is certainly a good thing, but it is
> *not* a replacement for fsync. On *any* platform.
>
> //Magnus
>

Oracle9 and SQL Server 2000 use this flag. Some comments on the
lost-data-concern about FILE_FLAG_WRITE_THROUGH:

(1) Assume you just use ordinary SCSI disks with write back cache on -
you will lost your data if the server suddently lost power;
you will *not* lost your data when OS crashes, server reset or whatever only
if the server has the power;
This has been verified with Oracle9 and SQL Server 2000.

(2) Turn off write back cache in disks, you will not lost data, but you
will see your performance decreased;

(3) If you use some advanced expensive disks like the battery-equipped
ones, then you can safely enable write back cache;

So UPS is useful for ordinary SCSI disks when write back cache is enabled,
but make sure don't let "somebody accidentally pulls the plug between the
UPS and the server" this unfortunate thing happen.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2005-02-18 04:31:37 Re: win32 performance - fsync question
Previous Message Gaetano Mendola 2005-02-18 00:45:20 Re: Help me recovering data