From: | "Magnus Hagander" <mha(at)sollentuna(dot)net> |
---|---|
To: | <lsunley(at)mb(dot)sympatico(dot)ca>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "E(dot)Rodichev" <er(at)sai(dot)msu(dot)su>, "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: win32 performance - fsync question |
Date: | 2005-02-17 17:32:08 |
Message-ID: | 6BCB9D8A16AC4241919521715F4D8BCE4768DD@algol.sollentuna.se |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
>>So by all means turn off fsync if you want the performance gain *and*
>>you accept the risk. But if you do, don't come crying later that your
>>data has been lost or corrupted.
>
>>(the results are interesting, though - with fsync off Windows
>and Linux
>>are in the same performance ballpark.)
Yes, this is definitly interesting. It confirms Merlins signs of I/O
being what kills the win32 version. IPC etc is a bit slower, but not
significantly.
>In anything I've done, Windows is very slow when you use fsync or the
>Windows API equivalent.
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.
Not much to do about the bgwriter, the way it is designed it *has* to
fsync during checkpoint. The Other Databases implement their own cache
and write data files directly also, but pg is designed to have the OS
cache helping out. Bypassing it would not be good for performance.
>If you need the performance, you had better have the machine
>hooked up to
>a UPS (probably a good idea in any case) and set up something that is
>triggered by the UPS running down to signal postgreSQL to do
>an immediate
>shutdown.
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
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2005-02-17 17:52:04 | Re: win32 performance - fsync question |
Previous Message | Thomas Hallgren | 2005-02-17 15:39:16 | Re: Terminating a SETOF function call sequence |