fastes way to write to disk (mmap, write, ...)



I need to write to disk as fast as possible (of course who does
not :-) )

Data is available as records of app. 1kByte each

After a number of such records (ie. 100) has been written, it must be
ensured that the data is physically on the disk (or at least within
some non volatile battary backup raid controller) and no longer in any
area of the O/S System where it could be lost i.e. due to a system
crash.

The data is written sequentially (appended at eof)

I know the following ways to implement this

-) direkt write using write(), issuing fsync after every 100 writes
-) private buffereing in memory and writing all data with one write()
+ fsync()
-) private buffereing in memory and writing all data using open() with
O_SYNC
-) mmaping the output file and writeing into the mapped memory using
msync() on the paged whenever 100 "writes" occured.

Does someone know better (faster) algorithms ?
What do you think is the fastes way ?
Is there any benefit of using mmap over direkt writes for files
written only. I guess that mmaped files require the
"old" (uninitialzed data) of the preextended file to be apged in only
to be overwritten soon. This should cause unneccesray disk IO. Is this
assumption correct?

Klaus
.



Relevant Pages

  • Proposed Assembler Commands
    ... ACM Automatically Clear Memory ... BKCRDR Backspace Card Reader ... BKSPD Backspace Disk ... EIAO Execute In Any Order ...
    (sci.electronics.design)
  • Re: Att. Alex Nichol -VM cont.
    ... I find documentation that says a 4kb page in memory is written to the hard ... manner that a 4kb memory page is equal to a 4kb cluster written on the disk". ... So where is the basis for saying since 4kb paging in memory that 4kb clusters ...
    (microsoft.public.windowsxp.general)
  • Re: Slow performance
    ... Leaving your computer on 24/7 means that if any programme has a memory ... The Disk Defragmenter report shows you have minimal free disk space. ... select Properties, General, Advanced and check the box before Compress ... Volume fragmentation ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: teaching a child - console or GUI
    ... I use a RDBMS to reuse existing code and optimizations. ... >>And loading them in a system under load (with constant disk io) is worse ... quality stuff), and quality power supply, quality memory etc. ... > lists of pointers on disk, extract files of frequent search fields in ...
    (comp.lang.pascal.delphi.misc)
  • Re: Slow performance
    ... I realize that the pagefile usage is excessive and I need to reduce memory ... I've never messed with those settings before. ... Peak are greatly in excess of the installed RAM. ... The Disk Defragmenter report shows you have minimal free disk space. ...
    (microsoft.public.windowsxp.perform_maintain)