Re: need fastest way to write 2gig array to disk file

From: Jan Panteltje (pNaonStpealmtje_at_yahoo.com)
Date: 09/09/05


Date: Fri, 09 Sep 2005 21:49:54 GMT

On a sunny day (Fri, 09 Sep 2005 13:55:35 -0700) it happened Eric Taylor
<et1@rocketship1.com> wrote in <4321F6C7.5B254CAA@rocketship1.com>:

>I have a two gigabtye array. From a nothing special C program
>what is the fastest way to write this to a disk file.
>
>I'm currently using fwrite with 25meg shots at a time so I can
>provide a % progress output. I am seeing very different
>results.
>
>On one system, a 12 gig 2.6 kernel (redhat el4 hugemem) all the
>writes seem to go directly to the cache and so a 2 gig output
>takes under 30 seconds before the program thinks it's done.
>
>On another similar system, with scsi disks, once the program
>has written about 800 meg, it slows down to about 4 meg/sec
>as reported by iostat. (when writing to the cache, it says about
>70meg/sec).
>
>Top says almost all the memory is free, except what I'm using.
>If once it is done with writing one file (2 gigs) I start it writing a
>a second file, it goes slow throughout. If while it is
>writing, I delete the first file, then it takes off again, presumably
>writing to the cache which has now been freed up.
>
>Are there tuning parameters to set the maximum amount of cache,
>or some way to base it on the amount of free memory left?
>
>And why would a write from memory to a scsi disk go at only
>4 mb/sec. That seems awfully slow.
>
>any help would be most ap-t perform device read timings
 -T perform cache read timings
 preciated.
>
>eric
I usually first check what the disk IO can really do with hdparm:
hdparm -t /dev/hdx performs device read timings
hdparm -T /dev/hdx performs cache read timings
It will never be faster then that.
Perhaps the update program has some influence, it sets how often the
data is actualy written to the hardware (disk).
update -h
update -d shows current settings.
lower values for the 1, 4, and 5 option can have some effect.
Of cause you could check the BIOS settings too, if correct PIO mode etc.
I have little experience with scsi, but the one I had sucked, usually
it is better cheaper faster with IDE interface.
(Others will disagree).



Relevant Pages

  • Temporary lock-up under heavy write, MegaRAID RAID-5
    ... LSI Logic MegaRAID 320-1, 64MB cache ... when writing very large files. ... disk write access, actually). ... The RAID controller is currently set to "write-through". ...
    (Debian-User)
  • Re: Continuous disk write performance in ported real-time application
    ... good use of RAM to cache the file before actually writing it to the CF ... see that Linux is writing out the buffered data to disk in spurts. ... Because the cache is useful for buffering and smoothing out the ...
    (comp.os.linux.embedded)
  • need fastest way to write 2gig array to disk file
    ... writes seem to go directly to the cache and so a 2 gig output ... (when writing to the cache, ... Top says almost all the memory is free, ... And why would a write from memory to a scsi disk go at only ...
    (comp.os.linux.development.apps)
  • Re: Continuous disk write performance in ported real-time application
    ... good use of RAM to cache the file before actually writing it to the CF ... see that Linux is writing out the buffered data to disk in spurts. ... Because the cache is useful for buffering and smoothing out the ...
    (comp.os.linux.embedded)
  • Re: Timing for various operations on a PC
    ... > In Peter Norvig's essay, "Teach Yourself Programming in Ten Years", ... > cache miss), read consecutive words from disk, and seek to a new ... > Especially things like time taken to fetch something from L1 cache? ... Although you could look the instruction timings in the CPU ...
    (comp.lang.lisp)