Re: lseek/write
- From: David Schwartz <davids@xxxxxxxxxxxxx>
- Date: Mon, 19 Nov 2007 11:33:10 -0800 (PST)
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
.
- Follow-Ups:
- Re: lseek/write
- From: golden
- Re: lseek/write
- References:
- lseek/write
- From: golden
- lseek/write
- Prev by Date: Re: module license taints kernel.
- Next by Date: Re: module license taints kernel.
- Previous by thread: Re: lseek/write
- Next by thread: Re: lseek/write
- Index(es):
Relevant Pages
|