Re: lseek/write



On Nov 18, 5:19 pm, golden <i...@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. The snippet of code that I am using is as
follows:

Your test does two very different things. If 'lseek' is called, it
keeps overwriting the same piece of information. If 'lseek' is not
called, it keeps writing new information each time. It slows down when
you remove the 'lseek' because with the 'lseek' the writes cannot fit
in cache and with it, they can.

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

Actually, your test bears that out. Why do you think not?

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

There's really no reason they should be, depending on how your SAN is
set up.

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

Well, duh. Synching is slow.

When I do not use the fsync, writes are
faster.

Right. Not synching is faster than synching.

I would appreciate any information regarding t his topic.

What do you find surprising exactly?

DS
.



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: lseek/write
    ... 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. ... EMC's cache isn't going to speed up getting the data from ...
    (comp.os.linux.development.system)
  • lseek/write
    ... I have a question regarding disk IO performance. ... opposed to not using lseek. ... When I do not use the fsync, ... exit; ...
    (comp.os.linux.development.system)