Re: lseek/write



In article <221607b8-04a5-47d4-b992-078a3db45d6e@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
golden <iang@xxxxxxxxxxxxx> wrote:

I have a question regarding disk IO performance. I would like to
understand why exactly writes to a disk are faster when I use
lseek as opposed to not using lseek.

Because seeking back to zero all the time means the writes get
written over before being flushed to disk.

I would imagine that the write keeps track of the pointer after
each write, but my test does not bear that out.

What "pointer" would that be? If you mean the current position in
the file, your lseek resets it to zero.

Ultimately, I am trying to determine why writes are faster to my
local disk than to my SAN storage (EMC w/ cache).

Perhaps because your SAN access is over a slow bus than the local
drive? EMC's cache isn't going to speed up getting the data from
your computer to the storage. It can only go as fast as the Fibre
Channel (or whatever else you use).

When I use the fsync, writes are slower to san.

Any reason you think they wouldn't be?

--
http://blameitonlove.com/
.



Relevant Pages

  • Re: lseek/write
    ... opposed to not using lseek. ... in cache and with it, ... When I call fsync i flush the cache to disk but only the new ... There's really no reason they should be, depending on how your SAN is ...
    (comp.os.linux.development.system)
  • Re: My first few weeks on the internet have been a security nightmare
    ... Use a DOS program to tell ... every sector of your HD to contain ZERO and ZERO you will get. ... Disk Operating System so it exists totally independent of the disk - it ... I would post ZAP ...
    (alt.computer.security)
  • Re: Write Signal on Disk II Question
    ... What happen when Disk II Controller attempts to detect read pulse at 2 ... It detects wide zero bit and it thinks to be zero bit before zero bit ... Does the software help capturing protected disks to images? ... Duplicating protected floppies is probably not in high demand these days. ...
    (comp.sys.apple2)
  • Re: CreateFile() and FILE_FLAG_WRITE_THROUGH
    ... On restart, the file testfile.txt exists but is zero bytes long because although ... So our so-called safe write to disk, is in this situation completely useless! ... We can then happily cut the power, confident that the data will have been ...
    (microsoft.public.win32.programmer.kernel)
  • Re: CreateFile() and FILE_FLAG_WRITE_THROUGH
    ... On restart, the file testfile.txt exists but is zero bytes long because ... So our so-called safe write to disk, ... We can then happily cut the power, confident that the data will have been ...
    (microsoft.public.win32.programmer.kernel)