need fastest way to write 2gig array to disk file

From: Eric Taylor (et1_at_rocketship1.com)
Date: 09/09/05


Date: Fri, 09 Sep 2005 13:55:35 -0700

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 appreciated.

eric



Relevant Pages

  • Re: What can I check to fix system performance?
    ... it seems you have plenty of memory available: ... copies of files you have read of written lately, in a cache, in case ... processes per CPU, or 40 in all. ... Consider the disk structure. ...
    (comp.os.linux.setup)
  • Re: Caching control
    ... |> | invalidate/unmap them in order to discard the data from memory. ... |> writing out to disk. ... | easy to discard as clean disk cache. ... stating that a specific amount of RAM can be used only for I/O ...
    (comp.os.linux.development.system)
  • Re: Scheduler: Process priority fed back to parent?
    ... > interactivity cache could estimate interactivity over a period of hours ... Then you don't even have to write it to the filesystem. ... For those of us with enough memory or a large variety of programs, ... That way the file is already in disk cache or on its way when the ...
    (Linux-Kernel)
  • Re: FreeBSD and poor ata performance
    ... Linux doesn't really have raw disk devices. ... All disk I/O is through the disk cache, ... performance (on a system with sufficient memory to hold all of the data ... sys 0m12.477s ...
    (freebsd-questions)
  • 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)